Last active
October 15, 2021 22:46
-
-
Save bogdanbujdea/5c0411ac455a98e089c6b825f802870a to your computer and use it in GitHub Desktop.
testdeploy.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"resourceAppId": "00000003-0000-0ff1-ce00-000000000000", | |
"resourceAccess": [ | |
{ | |
"id": "df021288-bdef-4463-88db-98f22de89214", | |
"type": "Role" | |
}, | |
{ | |
"id": "d13f72ca-a275-4b96-b789-48ebcc4da984", | |
"type": "Role" | |
} | |
] | |
}, | |
{ | |
"resourceAppId": "00000003-0000-0000-c000-000000000000", | |
"resourceAccess": [ | |
{ | |
"id": "e1fe6dd8-ba31-4d61-89e7-88639da4683d", | |
"type": "Scope" | |
}, | |
{ | |
"id": "332a536c-c7ef-4017-ab91-336970924f0d", | |
"type": "Role" | |
}, | |
{ | |
"id": "01d4889c-1287-42c6-ac1f-5d1e02578ef6", | |
"type": "Role" | |
}, | |
{ | |
"id": "df021288-bdef-4463-88db-98f22de89214", | |
"type": "Role" | |
}, | |
{ | |
"id": "5b567255-7703-4780-807c-7be8301ae99b", | |
"type": "Role" | |
} | |
] | |
} | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", | |
"contentVersion": "1.0.0.0", | |
"parameters": { | |
"environmentName": { | |
"defaultValue": "", | |
"type": "String", | |
"metadata": { | |
"description": "You can leave this empty" | |
} | |
}, | |
"appId": { | |
"defaultValue": "", | |
"type": "String", | |
"metadata": { | |
"description": "Microsoft App ID" | |
} | |
}, | |
"appSecret": { | |
"type": "string", | |
"defaultValue": "", | |
"metadata": { | |
"description": "Microsoft App Secret" | |
} | |
}, | |
"dbAdministratorLogin": { | |
"type": "string", | |
"defaultValue": "targoadmin", | |
"metadata": { | |
"description": "Administrator Login" | |
} | |
}, | |
"dbAdministratorLoginPassword": { | |
"defaultValue": "", | |
"type": "SecureString" | |
}, | |
"adminEmail": { | |
"type": "string", | |
"defaultValue": "admin@hhpberlin.org" | |
}, | |
"crmInstanceUrl": { | |
"type": "string", | |
"defaultValue": "<leave blank if not used>", | |
"metadata": { | |
"description": "CRM URL" | |
} | |
}, | |
"zepWSDLLocation": { | |
"type": "string", | |
"defaultValue": "", | |
"metadata": { | |
"description": "ZEP Wsdl Location" | |
} | |
}, | |
"zepToken": { | |
"type": "string", | |
"defaultValue": "", | |
"metadata": { | |
"description": "ZEP Wsdl Location" | |
} | |
} | |
}, | |
"variables": { | |
"targoStorageName": "[concat('targostorage', parameters('environmentName'))]", | |
"targoFunctions": "[concat('TargoFunctions', parameters('environmentName'))]", | |
"targoApiAppService": "[concat('TargoApi', parameters('environmentName'))]", | |
"teamsAppService": "[concat('TeamsApp', parameters('environmentName'))]", | |
"targoBotAppService": "[concat('TargoBot', parameters('environmentName'))]", | |
"targoDatabaseServerName": "[concat('targodb', parameters('environmentName'))]" | |
}, | |
"resources": [ | |
{ | |
"type": "microsoft.insights/components", | |
"apiVersion": "2020-02-02", | |
"name": "TargoInsights", | |
"location": "westeurope", | |
"kind": "web", | |
"properties": { | |
"Application_Type": "web", | |
"Flow_Type": "Redfield", | |
"Request_Source": "IbizaWebAppExtensionCreate", | |
"publicNetworkAccessForIngestion": "Enabled", | |
"publicNetworkAccessForQuery": "Enabled" | |
} | |
}, | |
{ | |
"type": "Microsoft.Sql/servers", | |
"apiVersion": "2021-02-01-preview", | |
"name": "[variables('targoDatabaseServerName')]", | |
"location": "westeurope", | |
"kind": "v12.0", | |
"properties": { | |
"administratorLogin": "exghtsadmin", | |
"version": "12.0", | |
"publicNetworkAccess": "Enabled", | |
"restrictOutboundNetworkAccess": "Disabled", | |
"administratorLoginPassword": "[parameters('dbAdministratorLoginPassword')]" | |
} | |
}, | |
{ | |
"type": "Microsoft.Storage/storageAccounts", | |
"apiVersion": "2021-04-01", | |
"name": "[variables('targoStorageName')]", | |
"location": "westeurope", | |
"sku": { | |
"name": "Standard_LRS", | |
"tier": "Standard" | |
}, | |
"kind": "Storage", | |
"properties": { | |
"minimumTlsVersion": "TLS1_2", | |
"networkAcls": { | |
"bypass": "AzureServices", | |
"virtualNetworkRules": [], | |
"ipRules": [], | |
"defaultAction": "Allow" | |
}, | |
"supportsHttpsTrafficOnly": true, | |
"encryption": { | |
"services": { | |
"file": { | |
"keyType": "Account", | |
"enabled": true | |
}, | |
"blob": { | |
"keyType": "Account", | |
"enabled": true | |
} | |
}, | |
"keySource": "Microsoft.Storage" | |
} | |
} | |
}, | |
{ | |
"type": "Microsoft.Web/serverfarms", | |
"apiVersion": "2018-02-01", | |
"name": "TargoFunctionsServerFarm", | |
"location": "West Europe", | |
"sku": { | |
"name": "Y1", | |
"tier": "Dynamic", | |
"size": "Y1", | |
"family": "Y", | |
"capacity": 0 | |
}, | |
"kind": "functionapp", | |
"properties": { | |
"perSiteScaling": false, | |
"maximumElasticWorkerCount": 1, | |
"isSpot": false, | |
"reserved": false, | |
"isXenon": false, | |
"hyperV": false, | |
"targetWorkerCount": 0, | |
"targetWorkerSizeId": 0 | |
} | |
}, | |
{ | |
"type": "Microsoft.Web/serverfarms", | |
"apiVersion": "2018-02-01", | |
"name": "TargoAppServiceServerFarm", | |
"location": "West Europe", | |
"sku": { | |
"name": "B1", | |
"tier": "Basic", | |
"size": "B1", | |
"family": "B", | |
"capacity": 1 | |
}, | |
"kind": "app", | |
"properties": { | |
"perSiteScaling": false, | |
"maximumElasticWorkerCount": 1, | |
"isSpot": false, | |
"reserved": false, | |
"isXenon": false, | |
"hyperV": false, | |
"targetWorkerCount": 0, | |
"targetWorkerSizeId": 0 | |
} | |
}, | |
{ | |
"type": "Microsoft.BotService/botServices/channels", | |
"apiVersion": "2021-03-01", | |
"name": "[concat('TargoAppBot', '/MsTeamsChannel')]", | |
"location": "global", | |
"dependsOn": [ | |
"[resourceId('Microsoft.BotService/botServices', 'TargoAppBot')]" | |
], | |
"properties": { | |
"properties": { | |
"enableCalling": false, | |
"isEnabled": true | |
}, | |
"channelName": "MsTeamsChannel" | |
} | |
}, | |
{ | |
"type": "Microsoft.BotService/botServices/channels", | |
"apiVersion": "2021-03-01", | |
"name": "[concat('TargoAppBot', '/WebChatChannel')]", | |
"location": "global", | |
"dependsOn": [ | |
"[resourceId('Microsoft.BotService/botServices', 'TargoAppBot')]" | |
], | |
"properties": { | |
"properties": { | |
"sites": [ | |
{ | |
"siteName": "Default Site", | |
"isEnabled": true | |
} | |
] | |
}, | |
"channelName": "WebChatChannel" | |
} | |
}, | |
{ | |
"type": "Microsoft.BotService/botServices/connections", | |
"apiVersion": "2021-03-01", | |
"name": "[concat('TargoAppBot', '/DynamicsAuth')]", | |
"location": "global", | |
"dependsOn": [ | |
"[resourceId('Microsoft.BotService/botServices', 'TargoAppBot')]" | |
], | |
"properties": { | |
"serviceProviderDisplayName": "Dynamics CRM Online", | |
"serviceProviderId": "51dd6264-6d45-4e46-b720-5ff7e8c28873" | |
} | |
}, | |
{ | |
"type": "Microsoft.BotService/botServices/connections", | |
"apiVersion": "2021-03-01", | |
"name": "[concat('TargoAppBot', '/MicrosoftGraph')]", | |
"location": "global", | |
"dependsOn": [ | |
"[resourceId('Microsoft.BotService/botServices', 'TargoAppBot')]" | |
], | |
"properties": { | |
"serviceProviderDisplayName": "Azure Active Directory v2", | |
"serviceProviderId": "30dd229c-58e3-4a48-bdfd-91ec48eb906c" | |
} | |
}, | |
{ | |
"type": "Microsoft.Sql/servers/databases", | |
"apiVersion": "2021-02-01-preview", | |
"name": "[concat(variables('targoDatabaseServerName'), '/Targo.Logic')]", | |
"location": "westeurope", | |
"dependsOn": [ | |
"[resourceId('Microsoft.Sql/servers', variables('targoDatabaseServerName'))]" | |
], | |
"sku": { | |
"name": "Standard", | |
"tier": "Standard", | |
"capacity": 10 | |
}, | |
"kind": "v12.0,user", | |
"properties": { | |
"collation": "SQL_Latin1_General_CP1_CI_AS", | |
"maxSizeBytes": 32212254720, | |
"catalogCollation": "SQL_Latin1_General_CP1_CI_AS", | |
"zoneRedundant": false, | |
"readScale": "Disabled", | |
"requestedBackupStorageRedundancy": "Geo", | |
"maintenanceConfigurationId": "/subscriptions/b5b2f6c2-4442-4e9a-be68-8c7c7377d1ef/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default", | |
"isLedgerOn": false | |
} | |
}, | |
{ | |
"type": "Microsoft.Sql/servers/databases", | |
"apiVersion": "2021-02-01-preview", | |
"name": "[concat(variables('targoDatabaseServerName'), '/Targo.Reporting')]", | |
"location": "westeurope", | |
"dependsOn": [ | |
"[resourceId('Microsoft.Sql/servers', variables('targoDatabaseServerName'))]" | |
], | |
"sku": { | |
"name": "Standard", | |
"tier": "Standard", | |
"capacity": 10 | |
}, | |
"kind": "v12.0,user", | |
"properties": { | |
"collation": "SQL_Latin1_General_CP1_CI_AS", | |
"maxSizeBytes": 32212254720, | |
"catalogCollation": "SQL_Latin1_General_CP1_CI_AS", | |
"zoneRedundant": false, | |
"readScale": "Disabled", | |
"requestedBackupStorageRedundancy": "Geo", | |
"maintenanceConfigurationId": "/subscriptions/b5b2f6c2-4442-4e9a-be68-8c7c7377d1ef/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default", | |
"isLedgerOn": false | |
} | |
}, | |
{ | |
"type": "Microsoft.Web/sites", | |
"apiVersion": "2018-11-01", | |
"name": "[variables('targoFunctions')]", | |
"location": "West Europe", | |
"dependsOn": [ | |
"[resourceId('Microsoft.Web/serverfarms', 'TargoFunctionsServerFarm')]" | |
], | |
"kind": "functionapp", | |
"properties": { | |
"enabled": true, | |
"hostNameSslStates": [ | |
{ | |
"name": "[concat(variables('targoFunctions'), '.azurewebsites.net')]", | |
"sslState": "Disabled", | |
"hostType": "Standard" | |
}, | |
{ | |
"name": "[concat(variables('targoFunctions'), '.scm.azurewebsites.net')]", | |
"sslState": "Disabled", | |
"hostType": "Repository" | |
} | |
], | |
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', 'TargoFunctionsServerFarm')]", | |
"reserved": false, | |
"isXenon": false, | |
"hyperV": false, | |
"siteConfig": { | |
"numberOfWorkers": 1, | |
"alwaysOn": false, | |
"http20Enabled": false | |
}, | |
"scmSiteAlsoStopped": false, | |
"clientAffinityEnabled": false, | |
"clientCertEnabled": false, | |
"hostNamesDisabled": false, | |
"containerSize": 1536, | |
"dailyMemoryTimeQuota": 0, | |
"httpsOnly": false, | |
"redundancyMode": "None" | |
}, | |
"resources": [ | |
{ | |
"apiVersion": "2020-06-01", | |
"name": "appsettings", | |
"type": "config", | |
"dependsOn": [ | |
"[resourceId('Microsoft.Web/sites', variables('targoFunctions'))]" | |
], | |
"properties": { | |
"FUNCTIONS_EXTENSION_VERSION": "latest", | |
"command": "deploy.cmd", | |
"CrmInstanceUrl": "[parameters('crmInstanceUrl')]", | |
"zepWSDLLocation": "[parameters('zepWSDLLocation')]", | |
"zepToken": "[parameters('zepToken')]", | |
"MicrosoftAppId": "[parameters('appId')]", | |
"MicrosoftappSecret": "[parameters('appSecret')]", | |
"AADClientId": "158294af-701f-43d7-9cd3-ca0f8e1e269a", | |
"AADClientSecret": "bJ0c6dvalPX7B7-_r_22r4~_4J9_FTwPei", | |
"APPINSIGHTS_INSTRUMENTATIONKEY": "[reference(resourceId('microsoft.insights/components', 'TargoInsights'), '2020-02-02').InstrumentationKey]", | |
"AzureWebJobsStorage": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('targoStorageName'), ';EndpointSuffix=', environment().suffixes.storage, ';AccountKey=',listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('targoStorageName')), '2021-04-01').keys[0].value)]", | |
"BlobContainerName": "targo-bot", | |
"ImagesContainer": "images", | |
"BlobAccountName": "[variables('targoStorageName')]", | |
"BlobAccountKey": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('targoStorageName')), '2021-04-01').keys[0].value]", | |
"TargoAdmin": "[parameters('adminEmail')]", | |
"TenantId": "[subscription().tenantId]", | |
"TrustServiceUri": "https://smba.trafficmanager.net/emea/" | |
} | |
}, | |
{ | |
"type": "config", | |
"apiVersion": "2020-06-01", | |
"name": "connectionstrings", | |
"dependsOn": [ | |
"[resourceId('Microsoft.Web/Sites', variables('targoFunctions'))]", | |
"[resourceId('Microsoft.SQL/Servers/databases', variables('targoDatabaseServerName'), 'Targo.Logic')]", | |
"[resourceId('Microsoft.SQL/Servers/databases', variables('targoDatabaseServerName'), 'Targo.Reporting')]" | |
], | |
"properties": { | |
"DbConnectionString": { | |
"value": "[concat('Data Source=tcp:', reference(resourceId('Microsoft.SQL/servers', variables('targoDatabaseServerName'))).fullyQualifiedDomainName, ',1433;Initial Catalog=', 'Targo.Logic', ';User Id=', parameters('dbAdministratorLogin'), '@', variables('targoDatabaseServerName'), ';Password=', parameters('dbAdministratorLoginPassword'), ';')]", | |
"type": "SQLAzure" | |
}, | |
"ReportingDbConnectionString": { | |
"value": "[concat('Data Source=tcp:', reference(resourceId('Microsoft.SQL/servers', variables('targoDatabaseServerName'))).fullyQualifiedDomainName, ',1433;Initial Catalog=', 'Targo.Reporting', ';User Id=', parameters('dbAdministratorLogin'), '@', variables('targoDatabaseServerName'), ';Password=', parameters('dbAdministratorLoginPassword'), ';')]", | |
"type": "SQLAzure" | |
} | |
} | |
} | |
] | |
}, | |
{ | |
"type": "Microsoft.Web/sites", | |
"apiVersion": "2018-11-01", | |
"name": "[variables('targoBotAppService')]", | |
"location": "West Europe", | |
"dependsOn": [ | |
"[resourceId('Microsoft.Web/serverfarms', 'TargoAppServiceServerFarm')]" | |
], | |
"kind": "app", | |
"properties": { | |
"enabled": true, | |
"hostNameSslStates": [ | |
{ | |
"name": "[concat(variables('targoBotAppService'), '.azurewebsites.net')]", | |
"sslState": "Disabled", | |
"hostType": "Standard" | |
}, | |
{ | |
"name": "[concat(variables('targoBotAppService'), '.scm.azurewebsites.net')]", | |
"sslState": "Disabled", | |
"hostType": "Repository" | |
} | |
], | |
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', 'TargoAppServiceServerFarm')]", | |
"reserved": false, | |
"isXenon": false, | |
"hyperV": false, | |
"siteConfig": { | |
"numberOfWorkers": 1, | |
"alwaysOn": false, | |
"http20Enabled": false, | |
"appSettings": [ | |
{ | |
"name": "CrmInstanceUrl", | |
"value": "[parameters('crmInstanceUrl')]" | |
}, | |
{ | |
"name": "ZepWSDLLocation", | |
"value": "[parameters('zepWSDLLocation')]" | |
}, | |
{ | |
"name": "ZepToken", | |
"value": "[parameters('zepToken')]" | |
}, | |
{ | |
"name": "MicrosoftAppId", | |
"value": "[parameters('appId')]" | |
}, | |
{ | |
"name": "MicrosoftappSecret", | |
"value": "[parameters('appSecret')]" | |
}, | |
{ | |
"name": "TargoAdmin", | |
"value": "[parameters('adminEmail')]" | |
}, | |
{ | |
"name": "AADClientId", | |
"value": "158294af-701f-43d7-9cd3-ca0f8e1e269a" | |
}, | |
{ | |
"name": "AADClientSecret", | |
"value": "bJ0c6dvalPX7B7-_r_22r4~_4J9_FTwPei" | |
}, | |
{ | |
"name": "APPINSIGHTS_INSTRUMENTATIONKEY", | |
"value": "[reference(resourceId('microsoft.insights/components', 'TargoInsights'), '2020-02-02').InstrumentationKey]" | |
}, | |
{ | |
"name": "AzureWebJobsStorage", | |
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('targoStorageName'), ';EndpointSuffix=', environment().suffixes.storage, ';AccountKey=',listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('targoStorageName')), '2021-04-01').keys[0].value)]" | |
}, | |
{ | |
"name": "BlobContainerName", | |
"value": "targo-bot" | |
}, | |
{ | |
"name": "BlobAccountName", | |
"value": "[variables('targoStorageName')]" | |
}, | |
{ | |
"name": "ImagesContainer", | |
"value": "images" | |
}, | |
{ | |
"name": "BlobAccountKey", | |
"value": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('targoStorageName')), '2021-04-01').keys[0].value]" | |
}, | |
{ | |
"name": "TenantId", | |
"value": "[subscription().tenantId]" | |
}, | |
{ | |
"name": "TrustServiceUri", | |
"value": "https://smba.trafficmanager.net/emea/" | |
} | |
] | |
}, | |
"scmSiteAlsoStopped": false, | |
"clientAffinityEnabled": true, | |
"clientCertEnabled": false, | |
"hostNamesDisabled": false, | |
"containerSize": 0, | |
"dailyMemoryTimeQuota": 0, | |
"httpsOnly": false, | |
"redundancyMode": "None" | |
}, | |
"resources": [ | |
{ | |
"type": "config", | |
"apiVersion": "2020-06-01", | |
"name": "connectionstrings", | |
"dependsOn": [ | |
"[resourceId('Microsoft.Web/sites', variables('targoBotAppService'))]", | |
"[resourceId('Microsoft.Sql/servers', variables('targoDatabaseServerName'))]" | |
], | |
"properties": { | |
"DbConnectionString": { | |
"value": "[concat('Data Source=tcp:', reference(resourceId('Microsoft.SQL/servers', variables('targoDatabaseServerName'))).fullyQualifiedDomainName, ',1433;Initial Catalog=', 'Targo.Logic', ';User Id=', parameters('dbAdministratorLogin'), '@', variables('targoDatabaseServerName'), ';Password=', parameters('dbAdministratorLoginPassword'), ';')]", | |
"type": "SQLAzure" | |
}, | |
"ReportingDbConnectionString": { | |
"value": "[concat('Data Source=tcp:', reference(resourceId('Microsoft.SQL/servers', variables('targoDatabaseServerName'))).fullyQualifiedDomainName, ',1433;Initial Catalog=', 'Targo.Reporting', ';User Id=', parameters('dbAdministratorLogin'), '@', variables('targoDatabaseServerName'), ';Password=', parameters('dbAdministratorLoginPassword'), ';')]", | |
"type": "SQLAzure" | |
} | |
} | |
} | |
] | |
}, | |
{ | |
"type": "Microsoft.Web/sites", | |
"apiVersion": "2018-11-01", | |
"name": "[variables('targoApiAppService')]", | |
"location": "West Europe", | |
"dependsOn": [ | |
"[resourceId('Microsoft.Web/serverfarms', 'TargoAppServiceServerFarm')]" | |
], | |
"kind": "app", | |
"properties": { | |
"enabled": true, | |
"hostNameSslStates": [ | |
{ | |
"name": "[concat(variables('targoApiAppService'), '.azurewebsites.net')]", | |
"sslState": "Disabled", | |
"hostType": "Standard" | |
}, | |
{ | |
"name": "[concat(variables('targoApiAppService'), '.scm.azurewebsites.net')]", | |
"sslState": "Disabled", | |
"hostType": "Repository" | |
} | |
], | |
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', 'TargoAppServiceServerFarm')]", | |
"reserved": false, | |
"isXenon": false, | |
"hyperV": false, | |
"siteConfig": { | |
"numberOfWorkers": 1, | |
"alwaysOn": false, | |
"http20Enabled": false, | |
"appSettings": [ | |
{ | |
"name": "CrmInstanceUrl", | |
"value": "[parameters('crmInstanceUrl')]" | |
}, | |
{ | |
"name": "ZepWSDLLocation", | |
"value": "[parameters('zepWSDLLocation')]" | |
}, | |
{ | |
"name": "ZepToken", | |
"value": "[parameters('zepToken')]" | |
}, | |
{ | |
"name": "MicrosoftAppId", | |
"value": "[parameters('appId')]" | |
}, | |
{ | |
"name": "MicrosoftappSecret", | |
"value": "[parameters('appSecret')]" | |
}, | |
{ | |
"name": "TargoAdmin", | |
"value": "[parameters('adminEmail')]" | |
}, | |
{ | |
"name": "AADClientId", | |
"value": "158294af-701f-43d7-9cd3-ca0f8e1e269a" | |
}, | |
{ | |
"name": "AADClientSecret", | |
"value": "bJ0c6dvalPX7B7-_r_22r4~_4J9_FTwPei" | |
}, | |
{ | |
"name": "APPINSIGHTS_INSTRUMENTATIONKEY", | |
"value": "[reference(resourceId('microsoft.insights/components', 'TargoInsights'), '2020-02-02').InstrumentationKey]" | |
}, | |
{ | |
"name": "AzureWebJobsStorage", | |
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('targoStorageName'), ';EndpointSuffix=', environment().suffixes.storage, ';AccountKey=',listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('targoStorageName')), '2021-04-01').keys[0].value)]" | |
}, | |
{ | |
"name": "BlobContainerName", | |
"value": "targo-bot" | |
}, | |
{ | |
"name": "BlobAccountName", | |
"value": "[variables('targoStorageName')]" | |
}, | |
{ | |
"name": "ImagesContainer", | |
"value": "images" | |
}, | |
{ | |
"name": "BlobAccountKey", | |
"value": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('targoStorageName')), '2021-04-01').keys[0].value]" | |
}, | |
{ | |
"name": "TenantId", | |
"value": "[subscription().tenantId]" | |
}, | |
{ | |
"name": "TrustServiceUri", | |
"value": "https://smba.trafficmanager.net/emea/" | |
} | |
] | |
}, | |
"scmSiteAlsoStopped": false, | |
"clientAffinityEnabled": true, | |
"clientCertEnabled": false, | |
"hostNamesDisabled": false, | |
"containerSize": 0, | |
"dailyMemoryTimeQuota": 0, | |
"httpsOnly": false, | |
"redundancyMode": "None" | |
}, | |
"resources": [ | |
{ | |
"type": "config", | |
"apiVersion": "2020-06-01", | |
"name": "connectionstrings", | |
"dependsOn": [ | |
"[resourceId('Microsoft.Web/sites', variables('targoApiAppService'))]", | |
"[resourceId('Microsoft.Sql/servers', variables('targoDatabaseServerName'))]" | |
], | |
"properties": { | |
"DbConnectionString": { | |
"value": "[concat('Data Source=tcp:', reference(resourceId('Microsoft.SQL/servers', variables('targoDatabaseServerName'))).fullyQualifiedDomainName, ',1433;Initial Catalog=', 'Targo.Logic', ';User Id=', parameters('dbAdministratorLogin'), '@', variables('targoDatabaseServerName'), ';Password=', parameters('dbAdministratorLoginPassword'), ';')]", | |
"type": "SQLAzure" | |
}, | |
"ReportingDbConnectionString": { | |
"value": "[concat('Data Source=tcp:', reference(resourceId('Microsoft.SQL/servers', variables('targoDatabaseServerName'))).fullyQualifiedDomainName, ',1433;Initial Catalog=', 'Targo.Reporting', ';User Id=', parameters('dbAdministratorLogin'), '@', variables('targoDatabaseServerName'), ';Password=', parameters('dbAdministratorLoginPassword'), ';')]", | |
"type": "SQLAzure" | |
} | |
} | |
} | |
] | |
}, | |
{ | |
"type": "Microsoft.Web/sites", | |
"apiVersion": "2018-11-01", | |
"name": "[variables('teamsAppService')]", | |
"location": "West Europe", | |
"dependsOn": [ | |
"[resourceId('Microsoft.Web/serverfarms', 'TargoAppServiceServerFarm')]" | |
], | |
"kind": "app", | |
"properties": { | |
"enabled": true, | |
"hostNameSslStates": [ | |
{ | |
"name": "[concat(variables('teamsAppService'), '.azurewebsites.net')]", | |
"sslState": "Disabled", | |
"hostType": "Standard" | |
}, | |
{ | |
"name": "[concat(variables('teamsAppService'), '.scm.azurewebsites.net')]", | |
"sslState": "Disabled", | |
"hostType": "Repository" | |
} | |
], | |
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', 'TargoAppServiceServerFarm')]", | |
"reserved": false, | |
"isXenon": false, | |
"hyperV": false, | |
"siteConfig": { | |
"numberOfWorkers": 1, | |
"alwaysOn": true, | |
"http20Enabled": false | |
}, | |
"scmSiteAlsoStopped": false, | |
"clientAffinityEnabled": true, | |
"clientCertEnabled": false, | |
"hostNamesDisabled": false, | |
"containerSize": 0, | |
"dailyMemoryTimeQuota": 0, | |
"httpsOnly": false, | |
"redundancyMode": "None" | |
} | |
}, | |
{ | |
"type": "Microsoft.Web/sites/config", | |
"apiVersion": "2018-11-01", | |
"name": "[concat(variables('targoFunctions'), '/web')]", | |
"location": "West Europe", | |
"dependsOn": [ | |
"[resourceId('Microsoft.Web/sites', variables('targoFunctions'))]" | |
], | |
"properties": { | |
"numberOfWorkers": 1, | |
"defaultDocuments": [ | |
"Default.htm", | |
"Default.html", | |
"Default.asp", | |
"index.htm", | |
"index.html", | |
"iisstart.htm", | |
"default.aspx", | |
"index.php" | |
], | |
"netFrameworkVersion": "v4.0", | |
"phpVersion": "5.6", | |
"requestTracingEnabled": false, | |
"remoteDebuggingEnabled": false, | |
"remoteDebuggingVersion": "VS2019", | |
"httpLoggingEnabled": false, | |
"logsDirectorySizeLimit": 35, | |
"detailedErrorLoggingEnabled": false, | |
"publishingUsername": "$targoapi", | |
"azureStorageAccounts": {}, | |
"scmType": "VSTSRM", | |
"use32BitWorkerProcess": true, | |
"webSocketsEnabled": false, | |
"alwaysOn": false, | |
"managedPipelineMode": "Integrated", | |
"virtualApplications": [ | |
{ | |
"virtualPath": "/", | |
"physicalPath": "site\\wwwroot", | |
"preloadEnabled": false | |
} | |
], | |
"loadBalancing": "LeastRequests", | |
"experiments": { | |
"rampUpRules": [] | |
}, | |
"autoHealEnabled": false, | |
"cors": { | |
"allowedOrigins": [ | |
"*" | |
], | |
"supportCredentials": false | |
}, | |
"localMySqlEnabled": false, | |
"ipSecurityRestrictions": [ | |
{ | |
"ipAddress": "Any", | |
"action": "Allow", | |
"priority": 1, | |
"name": "Allow all", | |
"description": "Allow all access" | |
} | |
], | |
"scmIpSecurityRestrictions": [ | |
{ | |
"ipAddress": "Any", | |
"action": "Allow", | |
"priority": 1, | |
"name": "Allow all", | |
"description": "Allow all access" | |
} | |
], | |
"scmIpSecurityRestrictionsUseMain": false, | |
"http20Enabled": false, | |
"minTlsVersion": "1.2", | |
"ftpsState": "AllAllowed", | |
"reservedInstanceCount": 0 | |
} | |
}, | |
{ | |
"type": "Microsoft.Web/sites/config", | |
"apiVersion": "2018-11-01", | |
"name": "[concat(variables('targoBotAppService'), '/web')]", | |
"location": "West Europe", | |
"dependsOn": [ | |
"[resourceId('Microsoft.Web/sites', variables('targoBotAppService'))]" | |
], | |
"properties": { | |
"numberOfWorkers": 1, | |
"defaultDocuments": [ | |
"Default.htm", | |
"Default.html", | |
"Default.asp", | |
"index.htm", | |
"index.html", | |
"iisstart.htm", | |
"default.aspx", | |
"index.php", | |
"hostingstart.html" | |
], | |
"netFrameworkVersion": "v4.0", | |
"phpVersion": "5.6", | |
"requestTracingEnabled": true, | |
"requestTracingExpirationTime": "9999-12-31T23:59:00Z", | |
"remoteDebuggingEnabled": false, | |
"remoteDebuggingVersion": "VS2019", | |
"httpLoggingEnabled": true, | |
"logsDirectorySizeLimit": 35, | |
"detailedErrorLoggingEnabled": true, | |
"publishingUsername": "$targoappbot", | |
"azureStorageAccounts": {}, | |
"scmType": "VSTSRM", | |
"use32BitWorkerProcess": true, | |
"webSocketsEnabled": true, | |
"alwaysOn": false, | |
"managedPipelineMode": "Integrated", | |
"virtualApplications": [ | |
{ | |
"virtualPath": "/", | |
"physicalPath": "site\\wwwroot", | |
"preloadEnabled": false | |
} | |
], | |
"loadBalancing": "LeastRequests", | |
"experiments": { | |
"rampUpRules": [] | |
}, | |
"autoHealEnabled": false, | |
"cors": { | |
"allowedOrigins": [ | |
"https://portal.azure.com", | |
"https://botservice.hosting.portal.azure.net", | |
"https://botservice-ms.hosting.portal.azure.net", | |
"https://hosting.onecloud.azure-test.net/" | |
], | |
"supportCredentials": false | |
}, | |
"localMySqlEnabled": false, | |
"ipSecurityRestrictions": [ | |
{ | |
"ipAddress": "Any", | |
"action": "Allow", | |
"priority": 1, | |
"name": "Allow all", | |
"description": "Allow all access" | |
} | |
], | |
"scmIpSecurityRestrictions": [ | |
{ | |
"ipAddress": "Any", | |
"action": "Allow", | |
"priority": 1, | |
"name": "Allow all", | |
"description": "Allow all access" | |
} | |
], | |
"scmIpSecurityRestrictionsUseMain": false, | |
"http20Enabled": false, | |
"minTlsVersion": "1.2", | |
"ftpsState": "AllAllowed", | |
"reservedInstanceCount": 0 | |
} | |
}, | |
{ | |
"type": "Microsoft.Web/sites/config", | |
"apiVersion": "2018-11-01", | |
"name": "[concat(variables('teamsAppService'), '/web')]", | |
"location": "West Europe", | |
"dependsOn": [ | |
"[resourceId('Microsoft.Web/sites', variables('teamsAppService'))]" | |
], | |
"properties": { | |
"numberOfWorkers": 1, | |
"defaultDocuments": [ | |
"Default.htm", | |
"Default.html", | |
"Default.asp", | |
"index.htm", | |
"index.html", | |
"iisstart.htm", | |
"default.aspx", | |
"index.php", | |
"hostingstart.html" | |
], | |
"netFrameworkVersion": "v4.0", | |
"nodeVersion": "~14", | |
"requestTracingEnabled": false, | |
"remoteDebuggingEnabled": false, | |
"remoteDebuggingVersion": "VS2019", | |
"httpLoggingEnabled": false, | |
"logsDirectorySizeLimit": 35, | |
"detailedErrorLoggingEnabled": false, | |
"publishingUsername": "$targoteams", | |
"azureStorageAccounts": {}, | |
"scmType": "VSTSRM", | |
"use32BitWorkerProcess": true, | |
"webSocketsEnabled": false, | |
"alwaysOn": true, | |
"managedPipelineMode": "Integrated", | |
"virtualApplications": [ | |
{ | |
"virtualPath": "/", | |
"physicalPath": "site\\wwwroot", | |
"preloadEnabled": true | |
} | |
], | |
"loadBalancing": "LeastRequests", | |
"experiments": { | |
"rampUpRules": [] | |
}, | |
"autoHealEnabled": false, | |
"localMySqlEnabled": false, | |
"ipSecurityRestrictions": [ | |
{ | |
"ipAddress": "Any", | |
"action": "Allow", | |
"priority": 1, | |
"name": "Allow all", | |
"description": "Allow all access" | |
} | |
], | |
"scmIpSecurityRestrictions": [ | |
{ | |
"ipAddress": "Any", | |
"action": "Allow", | |
"priority": 1, | |
"name": "Allow all", | |
"description": "Allow all access" | |
} | |
], | |
"scmIpSecurityRestrictionsUseMain": false, | |
"http20Enabled": false, | |
"minTlsVersion": "1.2", | |
"ftpsState": "AllAllowed", | |
"reservedInstanceCount": 0 | |
} | |
}, | |
{ | |
"type": "Microsoft.Web/sites/hostNameBindings", | |
"apiVersion": "2018-11-01", | |
"name": "[concat(variables('targoFunctions'), '/', variables('targoFunctions'), '.azurewebsites.net')]", | |
"location": "West Europe", | |
"dependsOn": [ | |
"[resourceId('Microsoft.Web/sites', variables('targoFunctions'))]" | |
], | |
"properties": { | |
"siteName": "targoapi", | |
"hostNameType": "Verified" | |
} | |
}, | |
{ | |
"type": "Microsoft.Web/sites/hostNameBindings", | |
"apiVersion": "2018-11-01", | |
"name": "[concat(variables('targoBotAppService'), '/', variables('targoBotAppService'), '.azurewebsites.net')]", | |
"location": "West Europe", | |
"dependsOn": [ | |
"[resourceId('Microsoft.Web/sites', variables('targoBotAppService'))]" | |
], | |
"properties": { | |
"siteName": "targoappbot", | |
"hostNameType": "Verified" | |
} | |
}, | |
{ | |
"type": "Microsoft.Web/sites/hostNameBindings", | |
"apiVersion": "2018-11-01", | |
"name": "[concat(variables('targoApiAppService'), '/', variables('targoApiAppService'), '.azurewebsites.net')]", | |
"location": "West Europe", | |
"dependsOn": [ | |
"[resourceId('Microsoft.Web/sites', variables('targoApiAppService'))]" | |
], | |
"properties": { | |
"siteName": "targoapi", | |
"hostNameType": "Verified" | |
} | |
}, | |
{ | |
"type": "Microsoft.Web/sites/hostNameBindings", | |
"apiVersion": "2018-11-01", | |
"name": "[concat(variables('teamsAppService'), '/', variables('teamsAppService'), '.azurewebsites.net')]", | |
"location": "West Europe", | |
"dependsOn": [ | |
"[resourceId('Microsoft.Web/sites', variables('teamsAppService'))]" | |
], | |
"properties": { | |
"siteName": "targoteams", | |
"hostNameType": "Verified" | |
} | |
}, | |
{ | |
"type": "Microsoft.Web/sites/siteextensions", | |
"apiVersion": "2018-11-01", | |
"name": "[concat(variables('targoBotAppService'), '/Microsoft.AspNetCore.AzureAppServices.SiteExtension')]", | |
"location": "West Europe", | |
"dependsOn": [ | |
"[resourceId('Microsoft.Web/sites', variables('targoBotAppService'))]" | |
] | |
} | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$appSecret=New-Guid | |
$securePassword=ConvertTo-SecureString -String $appSecret -AsPlainText -Force | |
$app=az ad app create --display-name $DisplayName --required-resource-accesses 'https://gist.githubusercontent.com/thewindev/5c0411ac455a98e089c6b825f802870a/raw/0a6d79ff647fb3c4085f286524db7bccac398fd7/manifest.json' --password $securePassword --available-to-other-tenants $false | ConvertFrom-Json | |
$DeploymentScriptOutputs=@{} | |
$appId=$app.appId; | |
$jobj=$app.oauth2Permissions | ConvertTo-Json -Depth 4 | ConvertFrom-Json | |
$permId=$jobj.id | |
echo $appId; | |
$apiObjectId=az ad app show --id $appId --query objectId | |
az rest ` | |
--method PATCH ` | |
--uri \"https://graph.microsoft.com/v1.0/applications/$apiObjectId\" ` | |
--headers 'Content-Type=application/json' ` | |
--body \"{api:{preAuthorizedApplications:[{appId:'5e3ce6c0-2b1f-4285-8d4b-75ee78787346',delegatedPermissionIds:['$permId']},{appId:'1fec8e78-bce4-4aaf-ab1b-5451cc387264',delegatedPermissionIds:['$permId']}]}}\" | |
$DeploymentScriptOutputs[$appId]=$appId | |
$DeploymentScriptOutputs[$appSecret]=$appSecret | |
Write-Output $appId |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment