-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathupload_swagger.ps1
More file actions
20 lines (20 loc) · 1.08 KB
/
upload_swagger.ps1
File metadata and controls
20 lines (20 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Add-AzureAccount
get-azuresubscription
select-azuresubscription '<Enter the name of your Azure Subscription>'
$StorageAccountName = "cloudintegrationtrainXX"
$StorageAccountKey = "<enter your storage key>"
$ctx = New-AzureStorageContext -StorageAccountName $StorageAccountName -StorageAccountKey $StorageAccountKey
$ContainerName = "swagger"
New-AzureStorageContainer -Name $ContainerName -Context $ctx -Permission Blob
$localFileDirectory = "C:\Users\bchesnut.CHESNUT\Downloads\"
$BlobName = "ConferenceApiApp_swagger.json"
$localFile = $localFileDirectory + $BlobName
#Set-AzureStorageBlobContent -File $localFile -Container $ContainerName -Blob $BlobName -Context $ctx
Get-AzureStorageBlob -Container $ContainerName -Context $ctx
#
# Setup CORS so Logic App can access
#
$CorsRules = (@{AllowedHeaders=@("*");AllowedOrigins=@("*");ExposedHeaders=@("content-length");MaxAgeInSeconds=200;AllowedMethods=@("Get","Connect", "Head")})
Set-AzureStorageCORSRule -ServiceType Blob -CorsRules $CorsRules -Context $ctx
$CorsRulesOut = Get-AzureStorageCORSRule -ServiceType Blob -Context $ctx
echo $CorsRulesOut