Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
https://mycompany.com/wfgen/auth/logout/returnhttps://<workflowgen url>/auth/callbackApplication ID URI property (e.g. https://<workflowgen url>/graphql) in the Expose an API section of the WorkflowGen GraphQL API application registration.curl "<METADATA URL>" | python -m json.tool<system.webServer>
<modules>
<remove name="ApplicationSecurityAuthenticationModule" />
</modules>
</system.webServer><!-- Microsoft Identity Platform v2 -->
<add key="ApplicationSecurityAuthProvider" value="ms-identity-v2"/>
<add key="ApplicationSecurityAuthClientId" value="<CLIENT ID>" />
<add key="ApplicationSecurityAuthClientSecret" value="<CLIENT SECRET>" />
<add key="ApplicationSecurityAuthMetadataUrl" value="<METADATA URL>" />
<add key="ApplicationSecurityAuthAppIdClaim" value="appid" />
<add key="ApplicationSecurityAuthUsernameClaim" value="preferred_username" />
<add key="ApplicationSecurityAuthClockTolerance" value="60" />
<add key="ApplicationSecurityAuthSessionRefreshEnableIFrame" value="Y"/>
<add key="ApplicationSecurityAuthAccessTokenUsernameClaim" value="upn" />
<add key="ApplicationSecurityAuthAdditionalScopes" value="https://<workflowgen url>/graphql/default" /><!-- Azure v1 auth -->
<add key="ApplicationSecurityAuthProvider" value="azure-v1"/>
<add key="ApplicationSecurityAuthClientId" value="<CLIENT ID>" />
<add key="ApplicationSecurityAuthClientSecret" value="<CLIENT SECRET>" />
<add key="ApplicationSecurityAuthMetadataUrl" value="<METADATA URL>" />
<add key="ApplicationSecurityAuthAppIdClaim" value="appid" />
<add key="ApplicationSecurityAuthUsernameClaim" value="upn" />
<add key="ApplicationSecurityAuthClockTolerance" value="60" />
<add key="ApplicationSecurityAuthSessionRefreshEnableIFrame" value="Y"/>
<add key="ApplicationSecurityAuthCheckSessionUrl" value="<CHECK SESSION URL>" /><add key="ApplicationSecurityAuthSessionTokenSigningSecret" value="<SECRET>" /><configuration>
<system.webServer>
<modules>
<add name="ApplicationSecurityAuthenticationModule" type="Advantys.Security.Http.JWTAuthenticationModule" />
</modules>
</system.webServer>
</configuration>{
"allowedMemberTypes": [
"Application"
],
"description": "Allows the application to get access to WorkflowGen GraphQL API.",
"displayName": "wfgen-graphql-full-access-role",
"id": "<NEW ID>",
"isEnabled": true,
"lang": null,
"origin": "Application",
"value": "wfgen-graphql-full-access-role"
}<add key="ApplicationSecurityAuthAudience" value="api://my-apis"/>
<add key="ApplicationSecurityAuthAdditionalScopes" value="api://my-apis/wfgen-graphql-full-access" />
<add key="ApplicationSecurityAuthGraphQLScope" value="wfgen-graphql-full-access" />
<add key="ApplicationSecurityAuthGraphQLAppRole" value="wfgen-graphql-full-access-role" />protected void Page_Load(object sender, EventArgs e)
{
base.Page_Load(sender, e);
string accessToken = this.CurrentUserAccessToken();
// Use accessToken to query GraphQL API or your third-party APIs...
}<configuration>
<appSettings>
<add key="ApplicationSecurityAuthAudience" value="https://graph.microsoft.com"/>
<add key="ApplicationSecurityAuthDecodeAccessToken" value="N"/>
</appSettings>
</configuration>My APIs applicationhttps://login.microsoftonline.com/<Tenant ID>/v2.0/.well-known/openid-configurationhttps://login.microsoftonline.com/<Tenant ID>/.well-known/openid-configurationInvoke-RestMethod -Uri "<METADATA URL>" -Method GET | ConvertTo-JSONTable of web.config optionsWorkflowGen Plus4b72dd6c-013e-4a9c-b837-f03a58cb8fd1workflowgenplus://auth.init?provider=ms-identity-v2&server_address=https%3A%2F%2Fmycompany.com%2Fwfgen&client_id=4b72dd6c-013e-4a9c-b837-f03a58cb8fd1&tenant_id=6g909d00-8580-49a4-9003-a30f6b87ae86&audience=https%3A%2F%2Fmycompany.com%2Fwfgen%2FgraphqlInstall-Module -Name AzureRM -AllowClobber
Import-Module -Name AzureRMLogin-AzureRmAccountSet-AzureRmSqlDatabase -ResourceGroupName <resource group> -ServerName <server name> -DatabaseName <database name> -ReadScale EnabledData Source=workflowgen.database.windows.net;Initial Catalog=WFGEN;User ID=wfgen_user;Password=Admin123!;encrypt=true;trustServerCertificate=false;ApplicationIntent=ReadWrite;Data Source=workflowgen.database.windows.net;Initial Catalog=WFGEN;User ID=wfgen_user;Password=Admin123!;encrypt=true;trustServerCertificate=false;ApplicationIntent=ReadOnly;WorkflowGen CLI <add key="ApplicationUrl" value="http[s]://<load balancer public IP address>/wfgen" />kubectl taint nodes "<NODE_NAME>" os=windows:NoScheduleapiVersion: apps/v1
kind: Deployment
metadata:
name: wfgen-webapps
spec:
replicas: 3
strategy:
type: Recreate
selector:
matchLabels:
app.kubernetes.io/name: workflowgen
app.kubernetes.io/component: webapps
template:
metadata:
labels:
app.kubernetes.io/name: workflowgen
app.kubernetes.io/component: webapps
spec:
containers:
- name: wfgen
image: advantys/workflowgen:7.18.3-win-ltsc2019
imagePullPolicy: Always
resources:
requests:
memory: "2Gi"
cpu: "1"
limits:
memory: "2Gi"
cpu: "1"
ports:
- name: http
containerPort: 80
protocol: TCP
envFrom:
- configMapRef:
name: wfgen-config
env:
- name: WFGEN_START_SERVICE
value: webapps
livenessProbe:
periodSeconds: 30
timeoutSeconds: 5
initialDelaySeconds: 60
exec:
command:
- powershell
- C:\healthcheck.ps1
livenessProbe:
timeoutSeconds: 5
initialDelaySeconds: 60
exec:
command:
- powershell
- -Command
- if (Test-Path "C:\iislog\W3SVC\*log") { return 0 } else { return 1 }
volumeMounts:
- mountPath: C:\wfgen\data
name: wfgdata
- mountPath: C:\wfgen\licenses
readOnly: true
name: licenses
- mountPath: C:\secrets
readOnly: true
name: secrets
volumes:
- name: wfgdata
persistentVolumeClaim:
claimName: wfgdata-pvc
- name: licenses
secret:
secretName: wfgen-license-secret
items:
# The following must match the name of the license item in
# the license secret, e.g. the name of the license file
- key: WorkflowGen.lic
path: WorkflowGen.lic
- name: secrets
secret:
secretName: wfgen-secnodeSelector:
kubernetes.io/os: windows
tolerations:
- key: os
operator: Equal
value: windows
effect: NoScheduleapiVersion: node.k8s.io/v1beta1
kind: RuntimeClass
metadata:
name: windows-1809
handler: 'docker'
scheduling:
nodeSelector:
kubernetes.io/os: 'windows'
kubernetes.io/arch: 'amd64'
node.kubernetes.io/windows-build: '10.0.17763'
tolerations:
- key: os
operator: Equal
value: windows
effect: NoSchedulekubectl apply -f windows-runtimeclass.yamlruntimeClass: windows-1809DRIVE:\temp.
wfgen_user$sqlUserPassword<database user> with the database user (e.g. wfgen_user). -- Replace <database name>, <database user>, and <password> with the ones you choose (e.g. WFGEN, wfgen_user, <YourPWD>!)
-- Create SQL Login template for Azure SQL Database and Azure SQL Data Warehouse Database
CREATE LOGIN <database user>
WITH PASSWORD = '<password>'
GO
-- Create SQL Login template for Azure SQL Database and Azure SQL Data Warehouse Database
CREATE USER <database user>
FROM LOGIN <database user>
WITH DEFAULT_SCHEMA = <database name>
GO
-- Add user to the database owner role
EXEC sp_addrolemember N'db_datawriter', N'<database user>'
EXEC sp_addrolemember N'db_datareader', N'<database user>'
GO# Configuration variables
$resourceGroup= "workflowgen"
$location="East US"
$sqlServer="wfgen-sql-server"
$sqlAdminUsername="wfgen_sa"
$sqlAdminPassword="<your(Strong!)password1>"
$sqlDatabase="WFGEN"
$sqlServiceObjective="Basic"
$connectionStringWithSqlAdmin = "Server=tcp:$sqlServer.database.windows.net,1433;Initial Catalog=$sqlDatabase;Persist Security Info=False;User ID=$sqlAdminUsername;Password=$sqlAdminPassword;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;"
$sqlScriptPath = "C:\Azure\setup\sql"
$sqlScriptCreation = Join-Path $sqlScriptPath "create.sql"
# Create the Azure SQL Server
az sql server create `
--resource-group $resourceGroup `
--location $location `
--name $sqlServer `
--admin-user $sqlAdminUsername `
--admin-password $sqlAdminPassword
# Enable Azure internal services access
az sql server firewall-rule create `
--resource-group $resourceGroup `
--server $sqlServer `
--name AllowAzureServices `
--start-ip-address 0.0.0.0 `
--end-ip-address 0.0.0.0
# Azure SQL database creation
az sql db create `
--name $sqlDatabase `
--resource-group $resourceGroup `
--server $sqlServer `
--service-objective $sqlServiceObjective
# Allow my public IP to access the SQL Server
$myPublicIP = (Invoke-WebRequest https://itomation.ca/mypublicip).content
az sql server firewall-rule create `
--resource-group $resourceGroup `
--server $sqlServer `
--name AllowMyTempPublicIP `
--start-ip-address $myPublicIP `
--end-ip-address $myPublicIP
# Initialize the database
Invoke-Sqlcmd `
-ConnectionString $connectionStringWithSqlAdmin `
-InputFile $sqlScriptCreation
# Remove my public IP
az sql server firewall-rule delete `
--resource-group $resourceGroup `
--server $sqlServer `
--name AllowMyTempPublicIP # Database user credentials
$sqlUserUsername = "wfgen_user"
$sqlUserPassword = "<your(Strong!)Password>"
# Allow my public IP to access the SQL Server
$myPublicIP = (Invoke-WebRequest https://itomation.ca/mypublicip).content
az sql server firewall-rule create `
--resource-group $resourceGroup `
--server $sqlServer `
--name AllowMyTempPublicIP `
--start-ip-address $myPublicIP `
--end-ip-address $myPublicIP
# Create the database user in the contained database
$queryVariables = "USERNAME=$sqlUserUsername","PASSWORD='$sqlUserPassword'"
Invoke-Sqlcmd `
-ConnectionString $connectionStringWithSqlAdmin `
-Query '
CREATE USER $(USERNAME) WITH PASSWORD = $(PASSWORD);
ALTER ROLE db_datareader ADD MEMBER $(USERNAME);
ALTER ROLE db_datawriter ADD MEMBER $(USERNAME);
' `
-Variable $queryVariables
# Remove my public IP
az sql server firewall-rule delete `
--resource-group $resourceGroup `
--server $sqlServer `
--name AllowMyTempPublicIP <add name="MainDbSource" connectionString="Data Source=<server name>;Initial Catalog=<database name>;User ID=<database user>;Password=<password>;encrypt=true;trustServerCertificate=false;" providerName="System.Data.SqlClient" /># Master database connection string
$connectionStringMaster = "Server=tcp:$sqlServer.database.windows.net,1433;Persist Security Info=False;User ID=$sqlAdminUsername;Password=$sqlAdminPassword;MultipleActiveResultSets=False;Encrypt=True;"
# Database user credentials
$sqlUserUsername = "wfgen_user"
$sqlUserPassword = "<your(Strong!)Password>"
# Allow my public IP to access the SQL Server
$myPublicIP = (Invoke-WebRequest https://itomation.ca/mypublicip).content
az sql server firewall-rule create `
--resource-group $resourceGroup `
--server $sqlServer `
--name AllowMyTempPublicIP `
--start-ip-address $myPublicIP `
--end-ip-address $myPublicIP
# Create the database login in the master db
$queryVariables = "USERNAME=$sqlUserUsername","PASSWORD='$sqlUserPassword'","DATABASE=$sqlDatabase"
Invoke-Sqlcmd `
-ConnectionString $connectionStringMaster `
-Query '
CREATE LOGIN $(USERNAME) WITH PASSWORD = $(PASSWORD);
' `
-Variable $queryVariables
# Create the user in the WorkflowGen database
Invoke-Sqlcmd `
-ConnectionString $connectionStringWithSqlAdmin `
-Query '
CREATE USER $(USERNAME) FROM LOGIN $(USERNAME) WITH DEFAULT_SCHEMA = $(DATABASE);
ALTER ROLE db_datareader ADD MEMBER $(USERNAME);
ALTER ROLE db_datawriter ADD MEMBER $(USERNAME);
' `
-Variable $queryVariables
# Remove my public IP
az sql server firewall-rule delete `
--resource-group $resourceGroup `
--server $sqlServer `
--name AllowMyTempPublicIPcurl --location --request POST 'https://login.microsoftonline.com/<Tenant ID>/oauth2/v2.0/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'client_id=<Client ID>' \
--data-urlencode 'client_secret=<Client Secret>' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'scope=https://<workflowgen url>/graphql/.default'
{
"token_type": "Bearer",
"expires_in": 3599,
"ext_expires_in": 3599,
"access_token": "<access token>"
}curl --location --request POST 'https://mycompany.com/wfgen/graphql' \
--header 'Authorization: Bearer <access token>' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'query={
viewer {
userName
}
}'{
"data": {
"viewer": {
"userName": "[email protected]"
}
}
} Test-NetConnection -ComputerName "wfgendatastorage.file.core.windows.net" -Port 445# Configuration variables
$location="East US"
$resourceGroup="wfgenresourcegroup"
$storageAccount="wfgendatastorage"
# Create a Storage account
az storage account create `
--name $storageAccount `
--resource-group $resourceGroup `
--location $location# Configuration variables
$storageAccount="wfgendatastorage"
$share="wfgenshare"
# Create the file shares
az storage share create `
--name $share `
--account-name $storageAccount `

Install-Module -Name Az -AllowClobber
Import-Module -Name Az Connect-AzAccount Account : <your-microsoft-azure-account-name>
SubscriptionName : <your-subscription-name>
TenantId : <your-tenant-id>
Environment : AzureCloud$resourceGroupName = "wfgenresourcegroup"
$storageAccountName = "wfgendatastorage"
$storageAccount = Get-AzStorageAccount -ResourceGroupName $resourceGroupName -Name $storageAccountName
$storageAccountKeys = Get-AzStorageAccountKey -ResourceGroupName $resourceGroupName -Name $storageAccountName
Invoke-Expression -Command "cmdkey /add:$([System.Uri]::new($storageAccount.Context.FileEndPoint).Host) /user:AZURE\$($storageAccount.StorageAccountName) /pass:$($storageAccountKeys[0].Value)"cmdkey /listTarget: Domain:target=wfgendatastorage.file.core.windows.net
Type: Domain Password
User: AZURE\wfgendatastorage\\wfgendatastorage.file.core.windows.net\wfgenshare Copy-Item -Path "C:\inetpub\wwwroot\wfgen\App_Data" -Recurse -Destination "\\wfgendatastorage.file.core.windows.net\wfgenshare" -Container<add key="ApplicationDataPath" value="\\wfgendatastorage.file.core.windows.net\wfgenshare\App_Data" />CMDKEY: Credential added successfully. $acctKey = ConvertTo-SecureString -String "aftEV8YUKljZeiwKP9Ts/kZysDASFVFsvSqAvWVjMb3E+QP4BWpVSNLVyqB2ScZjGtEIg/k0P7WBIg==" -AsPlainText -Force
$credential = New-Object System.Management.Automation.PSCredential -ArgumentList "Azure\wfgendatastorage", $acctKey
New-PSDrive -Name Z -PSProvider FileSystem -Root "\\wfgendatastorage.file.core.windows.net\wfgenshare" -Credential $credential -PersistWorkflowGen SCIM v2systemIdentifier properties set to their corresponding ME-ID objectId properties.WfgDirectoriesSyncService.exe) if it's been installed and started.groups = fetch_groups_from_azure()
for group in groups:
for user in group.users:
wfgUser = fetch_wfg_user_with_key(user.something)
wfgUser.systemIdentifier = user.objectId
update(wfgUser)
wfgGroup = fetch_wfg_group_with_key(group.something)
wfgGroup.systemIdentifier = group.objectId
update(wfgGroup)users = fetch_users_from_azure()
for user in users:
wfgUser = fetch_wfg_user_with_key(user.something)
wfgUser.systemIdentifier = user.objectId
update(wfgUser)