@@ -145,6 +145,8 @@ Function ConfigureApplications
145
145
so that they are consistent with the Applications parameters
146
146
#>
147
147
148
+ $commonendpoint = " common"
149
+
148
150
# $tenantId is the Active Directory Tenant. This is a GUID which represents the "Directory ID" of the AzureAD tenant
149
151
# into which you want to create the apps. Look it up in the Azure portal in the "Properties" of the Azure AD.
150
152
@@ -201,8 +203,8 @@ Function ConfigureApplications
201
203
$owner = Get-AzureADApplicationOwner - ObjectId $webAppAadApplication.ObjectId
202
204
if ($owner -eq $null )
203
205
{
204
- Add-AzureADApplicationOwner - ObjectId $webAppAadApplication.ObjectId - RefObjectId $user.ObjectId
205
- Write-Host " '$ ( $user.UserPrincipalName ) ' added as an application owner to app '$ ( $webAppServicePrincipal.DisplayName ) '"
206
+ Add-AzureADApplicationOwner - ObjectId $webAppAadApplication.ObjectId - RefObjectId $user.ObjectId
207
+ Write-Host " '$ ( $user.UserPrincipalName ) ' added as an application owner to app '$ ( $webAppServicePrincipal.DisplayName ) '"
206
208
}
207
209
208
210
Write-Host " Done creating the webApp application (WebApp)"
@@ -217,7 +219,21 @@ Function ConfigureApplications
217
219
# Add Required Resources Access (from 'webApp' to 'Microsoft Graph')
218
220
Write-Host " Getting access from 'webApp' to 'Microsoft Graph'"
219
221
$requiredPermissions = GetRequiredPermissions - applicationDisplayName " Microsoft Graph" `
220
- - requiredDelegatedPermissions " User.Read" ;
222
+ - requiredDelegatedPermissions " User.Read" `
223
+
224
+ $requiredResourcesAccess.Add ($requiredPermissions )
225
+
226
+ # Add Required Resources Access (from 'webApp' to 'Windows Azure Service Management API')
227
+ Write-Host " Getting access from 'webApp' to 'Windows Azure Service Management API'"
228
+ $requiredPermissions = GetRequiredPermissions - applicationDisplayName " Windows Azure Service Management API" `
229
+ - requiredDelegatedPermissions " user_impersonation" `
230
+
231
+ $requiredResourcesAccess.Add ($requiredPermissions )
232
+
233
+ # Add Required Resources Access (from 'webApp' to 'Azure Storage')
234
+ Write-Host " Getting access from 'webApp' to 'Azure Storage'"
235
+ $requiredPermissions = GetRequiredPermissions - applicationDisplayName " Azure Storage" `
236
+ - requiredDelegatedPermissions " user_impersonation" `
221
237
222
238
$requiredResourcesAccess.Add ($requiredPermissions )
223
239
@@ -226,11 +242,11 @@ Function ConfigureApplications
226
242
Write-Host " Granted permissions."
227
243
228
244
# Update config file for 'webApp'
229
- $configFile = $pwd.Path + " \..\active-directory-aspnetcore-webapp-openidconnect-v2\ appsettings.json"
245
+ $configFile = $pwd.Path + " \..\appsettings.json"
230
246
Write-Host " Updating the sample code ($configFile )"
231
- $dictionary = @ { " ClientId" = $webAppAadApplication.AppId ;" TenantId" = $tenantId ;" Domain" = $tenantName ;" TenantId " = $webAppAppKey };
247
+ $dictionary = @ { " ClientId" = $webAppAadApplication.AppId ;" TenantId" = $tenantId ;" Domain" = $tenantName ;" ClientSecret " = $webAppAppKey };
232
248
UpdateTextFile - configFilePath $configFile - dictionary $dictionary
233
-
249
+
234
250
Add-Content - Value " </tbody></table></body></html>" - Path createdApps.html
235
251
}
236
252
0 commit comments