diff --git a/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2020-11-01-preview/examples/Deployments_CreateOrUpdate.json b/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2020-11-01-preview/examples/Deployments_CreateOrUpdate.json index 5bea58897fbd..40b13b4a725f 100644 --- a/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2020-11-01-preview/examples/Deployments_CreateOrUpdate.json +++ b/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2020-11-01-preview/examples/Deployments_CreateOrUpdate.json @@ -18,13 +18,13 @@ "runtimeVersion": "Java_8" }, "instances": null + }, + "sku": { + "name": "S0", + "tier": "Standard", + "capacity": 1 } }, - "sku": { - "name": "S0", - "tier": "Standard", - "capacity": 1 - }, "api-version": "2020-11-01-preview", "subscriptionId": "00000000-0000-0000-0000-000000000000", "resourceGroupName": "myResourceGroup", diff --git a/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2020-11-01-preview/scenarios/Spring.yaml b/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2020-11-01-preview/scenarios/Spring.yaml new file mode 100644 index 000000000000..2d514e5151c8 --- /dev/null +++ b/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2020-11-01-preview/scenarios/Spring.yaml @@ -0,0 +1,372 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/documentation/api-scenario/references/v1.2/schema.json +scope: ResourceGroup + +variables: + serviceName: test-scenario-instance + appName: app01 + ascDomainName: .azuremicroservices.io + dnsCname: asc + customDomainName: + type: string + mysqlKey: + type: secureString + dnsSubscriptionId: + type: string + dnsResourceGroup: + type: string + blobUrl: + type: secureString + userAssignedIdentity: + type: string + +prepareSteps: + - step: Generate_Unique_ServiceName + armTemplate: templates/generate_service_name.json + + - step: Create_Application_Insight_Instance + armTemplate: templates/create_application_insights_instance.json + + - step: Add_Dns_Cname_Record + armDeploymentScript: ./templates/create_cname_record.ps1 + environmentVariables: + - name: resourceGroupName + value: $(dnsResourceGroup) + - name: dnsZoneName + value: $(customDomainName) + - name: dnsCname + value: $(dnsCname) + - name: dnsCnameAlias + value: $(serviceName)$(ascDomainName) + variables: + subscriptionId: $(dnsSubscriptionId) + resourceGroupName: $(dnsResourceGroup) + +scenarios: + - scenario: Spring + description: Microsoft.AppPlatform/Spring + steps: + - step: Services_CheckNameAvailability + exampleFile: ../examples/Services_CheckNameAvailability.json + requestUpdate: + - replace: /availabilityParameters/name + value: $(serviceName) + + # Services + - step: Services_CreateOrUpdate + exampleFile: ../examples/Services_CreateOrUpdate.json + + - step: Services_Get + exampleFile: ../examples/Services_Get.json + + - step: Services_Update + exampleFile: ../examples/Services_Update.json + requestUpdate: + - replace: /resource/tags + value: + hello: world + created-by: api-test + + - step: Services_DisableTestEndpoint + exampleFile: ../examples/Services_DisableTestEndpoint.json + + - step: Services_EnableTestEndpoint + exampleFile: ../examples/Services_EnableTestEndpoint.json + + - step: Services_RegenerateTestKey + exampleFile: ../examples/Services_RegenerateTestKey.json + + - step: Services_ListTestKeys + exampleFile: ../examples/Services_ListTestKeys.json + + - step: Certificates_CreateOrUpdate + exampleFile: ../examples/Certificates_CreateOrUpdate.json + variables: + certificateName: asc-certificate + requestUpdate: + - replace: /certificateResource/properties + value: + vaultUri: https://integration-test-prod.vault.azure.net/ + keyVaultCertName: pfx-cert + + - step: Certificates_Get + exampleFile: ../examples/Certificates_Get.json + variables: + certificateName: asc-certificate + + - step: Certificates_List + exampleFile: ../examples/Certificates_List.json + + # ConfigServers + - step: ConfigServers_Validate + exampleFile: ../examples/ConfigServers_Validate.json + requestUpdate: + - replace: /configServerSettings/gitProperty + value: + uri: https://github.com/VSChina/asc-config-server-test-public.git + label: master + searchPaths: ["/"] + + - step: ConfigServers_UpdatePut + exampleFile: ../examples/ConfigServers_UpdatePut.json + requestUpdate: + - replace: /configServerResource/properties/configServer/gitProperty + value: + uri: https://github.com/VSChina/asc-config-server-test-public.git + label: master + searchPaths: ["/"] + + - step: ConfigServers_UpdatePatch + exampleFile: ../examples/ConfigServers_UpdatePatch.json + requestUpdate: + - replace: /configServerResource/properties/configServer/gitProperty + value: + uri: https://github.com/azure-samples/spring-petclinic-microservices-config + + - step: ConfigServers_Get + exampleFile: ../examples/ConfigServers_Get.json + + # Monitoring + - step: MonitoringSettings_UpdatePut + exampleFile: ../examples/MonitoringSettings_UpdatePut.json + requestUpdate: + - replace: /monitoringSettingResource/properties + value: + traceEnabled: true + appInsightsInstrumentationKey: "$(insightsInstrumentationKey)" + appInsightsSamplingRate: 50.0 + + - step: MonitoringSettings_Get + exampleFile: ../examples/MonitoringSettings_Get.json + + - step: MonitoringSettings_UpdatePatch + exampleFile: ../examples/MonitoringSettings_UpdatePatch.json + requestUpdate: + - replace: /monitoringSettingResource/properties/appInsightsSamplingRate + value: 100 + + # Apps + - step: Apps_Create + exampleFile: ../examples/Apps_CreateOrUpdate.json + requestUpdate: + - remove: /appResource/properties/temporaryDisk + - remove: /appResource/properties/persistentDisk + - replace: /appResource/properties/public + value: false + + - step: Apps_Get + exampleFile: ../examples/Apps_Get.json + + - step: Deployments_CreateOrUpdate_Default + exampleFile: ../examples/Deployments_CreateOrUpdate.json + variables: + deploymentName: default + requestUpdate: + - replace: /deploymentResource/properties/source/type + value: Jar + - replace: /deploymentResource/properties/source/relativePath + value: "" + + - step: Deployments_Get + exampleFile: ../examples/Deployments_Get.json + variables: + deploymentName: default + + - step: Apps_Update_ActiveDeployment # PATCH + exampleFile: ../examples/Apps_Update.json + requestUpdate: + - replace: /appResource/properties/activeDeploymentName + value: default + + - step: Apps_Update_Disk # PATCH + exampleFile: ../examples/Apps_Update.json + requestUpdate: + - replace: /appResource/properties/temporaryDisk + value: { "sizeInGB": 3, "mountPath": "/tmpdisk" } + - replace: /appResource/properties/persistentDisk + value: { "sizeInGB": 10, "mountPath": "/data" } + - replace: /appResource/properties/public + value: true + + - step: Apps_List + exampleFile: ../examples/Apps_List.json + + # # Bindings + - step: Bindings_Create + exampleFile: ../examples/Bindings_CreateOrUpdate.json + variables: + bindingName: mysql-binding + requestUpdate: + - replace: /bindingResource/properties/resourceId + value: "/subscriptions/b46590cb-a111-4b84-935f-c305aaf1f424/resourceGroups/mary-west/providers/Microsoft.DBforMySQL/servers/fake-sql" + - replace: /bindingResource/properties/key + value: $(mysqlKey) + - replace: /bindingResource/properties/bindingParameters + value: { "databaseName": "mysqldb", "username": "test" } + + - step: Bindings_Update # PATCH + exampleFile: ../examples/Bindings_Update.json + variables: + bindingName: mysql-binding + requestUpdate: + - replace: /bindingResource/properties/key + value: $(mysqlKey) + - replace: /bindingResource/properties/bindingParameters + value: { "databaseName": "mysqldb2", "username": "test2" } + + - step: Bindings_Get + exampleFile: ../examples/Bindings_Get.json + variables: + bindingName: mysql-binding + + - step: Bindings_List + exampleFile: ../examples/Bindings_List.json + + - step: Bindings_Delete + exampleFile: ../examples/Bindings_Delete.json + variables: + bindingName: mysql-binding + + # CustomDomains # depends on DNS + - step: Apps_ValidateDomain + exampleFile: ../examples/Apps_ValidateDomain.json + requestUpdate: + - replace: /validatePayload/name + value: $(customDomainName) + + - step: CustomDomains_CreateOrUpdate + exampleFile: ../examples/CustomDomains_CreateOrUpdate.json + variables: + domainName: $(dnsCname).$(customDomainName) + requestUpdate: + - replace: /domainResource/properties + value: { "certName": "asc-certificate" } + + - step: CustomDomains_Update + exampleFile: ../examples/CustomDomains_Update.json + variables: + domainName: $(dnsCname).$(customDomainName) + requestUpdate: + - replace: /domainResource/properties + value: { "certName": "asc-certificate" } # TODO: use another cert + + - step: CustomDomains_Get + exampleFile: ../examples/CustomDomains_Get.json + variables: + domainName: $(dnsCname).$(customDomainName) + + - step: CustomDomains_List + exampleFile: ../examples/CustomDomains_List.json + + # Deployments + - step: Apps_GetResourceUploadUrl + exampleFile: ../examples/Apps_GetResourceUploadUrl.json + outputVariables: + uploadUrl: + type: secureString + fromResponse: /uploadUrl + relativePath: + fromResponse: /relativePath + + - step: Upload_File + armDeploymentScript: ./templates/uploadJar.ps1 + environmentVariables: + - name: uploadUrl + value: $(uploadUrl) + - name: blobUrl + value: $(blobUrl) + + - step: Deployments_CreateOrUpdate + exampleFile: ../examples/Deployments_CreateOrUpdate.json + variables: + deploymentName: blue + requestUpdate: + - replace: /deploymentResource/sku/capacity + value: 2 + - replace: /deploymentResource/properties/source/type + value: Jar + - replace: /deploymentResource/properties/source/relativePath + value: $(relativePath) + + - step: Apps_Update # PATCH + exampleFile: ../examples/Apps_Update.json + requestUpdate: + - replace: /appResource/properties/activeDeploymentName + value: blue + + - step: Deployments_Restart + exampleFile: ../examples/Deployments_Restart.json + variables: + deploymentName: blue + + - step: Deployments_Stop + exampleFile: ../examples/Deployments_Stop.json + variables: + deploymentName: blue + + - step: Deployments_Start + exampleFile: ../examples/Deployments_Start.json + variables: + deploymentName: blue + + - step: Deployments_GetLogFileUrl + exampleFile: ../examples/Deployments_GetLogFileUrl.json + variables: + deploymentName: blue + + - step: Deployments_List + exampleFile: ../examples/Deployments_List.json + + - step: Deployments_ListForCluster + exampleFile: ../examples/Deployments_ListForCluster.json + + - step: Services_List + exampleFile: ../examples/Services_List.json + + - step: Services_ListBySubscription + exampleFile: ../examples/Services_ListBySubscription.json + + - step: Deployments_Delete + exampleFile: ../examples/Deployments_Delete.json + variables: + deploymentName: blue + + - step: CustomDomains_Delete + exampleFile: ../examples/CustomDomains_Delete.json + variables: + domainName: $(dnsCname).$(customDomainName) + + - step: Apps_Delete + variables: + appName: app01 + exampleFile: ../examples/Apps_Delete.json + + - step: Certificates_Delete + exampleFile: ../examples/Certificates_Delete.json + variables: + certificateName: asc-certificate + + - step: Services_Delete + exampleFile: ../examples/Services_Delete.json + + - step: Skus_List + exampleFile: ../examples/Skus_List.json + + # - step: RuntimeVersions_ListRuntimeVersions # ASC team bug + # exampleFile: ../examples/RuntimeVersions_ListRuntimeVersions.json + + - step: Operations_List + exampleFile: ../examples/Operations_List.json + +cleanUpSteps: + - step: delete_cname_record + armDeploymentScript: ./templates/delete_cname_record.ps1 + environmentVariables: + - name: resourceGroupName + value: $(dnsResourceGroup) + - name: dnsCname + value: $(dnsCname) + - name: dnsZoneName + value: $(customDomainName) + variables: + subscriptionId: $(dnsSubscriptionId) + resourceGroupName: $(dnsResourceGroup) diff --git a/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2020-11-01-preview/scenarios/basic.yaml b/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2020-11-01-preview/scenarios/basic.yaml new file mode 100644 index 000000000000..9857db0ed8fc --- /dev/null +++ b/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2020-11-01-preview/scenarios/basic.yaml @@ -0,0 +1,297 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/documentation/api-scenario/references/v1.2/schema.json +scope: ResourceGroup + +variables: + serviceName: test-scenario-instance + ascDomainName: .azuremicroservices.io + dnsCname: asc + customDomainName: + type: string + mysqlKey: + type: secureString + dnsSubscriptionId: + type: string + dnsResourceGroup: + type: string + blobUrl: + type: secureString + userAssignedIdentity: + type: string + resource: + type: object + value: + properties: {} + sku: + name: S0 + tier: Standard + location: eastus + tags: + key1: value1 + certificateName: asc-certificate + certificateResource: + type: object + value: + properties: + vaultUri: https://integration-test-prod.vault.azure.net/ + keyVaultCertName: pfx-cert + appName: app01 + appResource: + type: object + value: + properties: + public: false + activeDeploymentName: mydeployment1 + fqdn: myapp.mydomain.com + httpsOnly: false + enableEndToEndTLS: false + identity: null + location: eastus + deploymentName: default + deploymentResource: + type: object + value: + properties: + source: + type: Jar + relativePath: + version: "1.0" + artifactSelector: sub-module-1 + deploymentSettings: + cpu: 1 + memoryInGB: 3 + jvmOptions: "-Xms1G -Xmx3G" + environmentVariables: + env: test + runtimeVersion: Java_8 + instances: null + sku: + name: S0 + tier: Standard + capacity: 1 + bindingName: mysql-binding + bindingResource: + type: object + value: + properties: + resourceId: /subscriptions/b46590cb-a111-4b84-935f-c305aaf1f424/resourceGroups/mary-west/providers/Microsoft.DBforMySQL/servers/fake-sql + key: $(mysqlKey) + bindingParameters: + databaseName: mysqldb + username: test + domainName: $(dnsCname).$(customDomainName) + domainResource: + type: object + value: + properties: + certName: asc-certificate + +prepareSteps: + - step: Generate_Unique_ServiceName + armTemplate: templates/generate_service_name.json + + - step: Create_Application_Insight_Instance + armTemplate: templates/create_application_insights_instance.json + + - step: Add_Dns_Cname_Record + armDeploymentScript: ./templates/create_cname_record.ps1 + environmentVariables: + - name: resourceGroupName + value: $(dnsResourceGroup) + - name: dnsZoneName + value: $(customDomainName) + - name: dnsCname + value: $(dnsCname) + - name: dnsCnameAlias + value: $(serviceName)$(ascDomainName) + variables: + subscriptionId: $(dnsSubscriptionId) + resourceGroupName: $(dnsResourceGroup) + +scenarios: + - steps: + - operationId: Services_CheckNameAvailability + parameters: + availabilityParameters: + type: Microsoft.AppPlatform/Spring + name: $(serviceName) + + # Services + - operationId: Services_CreateOrUpdate + - operationId: Services_Get + - operationId: Services_Update + parameters: + resource: + tags: + hello: world + created-by: api-test + - operationId: Services_DisableTestEndpoint + - operationId: Services_EnableTestEndpoint + - operationId: Services_RegenerateTestKey + parameters: + regenerateTestKeyRequest: + keyType: Primary + - operationId: Services_ListTestKeys + - operationId: Certificates_CreateOrUpdate + - operationId: Certificates_Get + - operationId: Certificates_List + + # ConfigServers + - operationId: ConfigServers_Validate + parameters: + configServerSettings: + gitProperty: + uri: https://github.com/VSChina/asc-config-server-test-public.git + label: master + searchPaths: + - "/" + - operationId: ConfigServers_UpdatePut + parameters: + configServerResource: + properties: + configServer: + gitProperty: + uri: https://github.com/VSChina/asc-config-server-test-public.git + label: master + searchPaths: + - "/" + - operationId: ConfigServers_UpdatePatch + parameters: + configServerResource: + properties: + gitProperty: + uri: https://github.com/azure-samples/spring-petclinic-microservices-config + - operationId: ConfigServers_Get + + # Monitoring + - operationId: MonitoringSettings_UpdatePut + parameters: + monitoringSettingResource: + properties: + traceEnabled: true + appInsightsInstrumentationKey: $(insightsInstrumentationKey) + appInsightsSamplingRate: 50.0 + - operationId: MonitoringSettings_Get + - operationId: MonitoringSettings_UpdatePatch + parameters: + monitoringSettingResource: + properties: + appInsightsSamplingRate: 100 + + # Apps + - operationId: Apps_CreateOrUpdate + - operationId: Apps_Get + - operationId: Deployments_CreateOrUpdate + - operationId: Deployments_Get + - operationId: Apps_Update + parameters: + appResource: + properties: + activeDeploymentName: $(deploymentName) + - operationId: Apps_Update + parameters: + appResource: + properties: + temporaryDisk: + sizeInGB: 3 + mountPath: /tmpdisk + persistentDisk: + sizeInGB: 10 + mountPath: /data + public: true + - operationId: Apps_List + + # Bindings + - operationId: Bindings_CreateOrUpdate + - operationId: Bindings_Update + parameters: + bindingResource: + properties: + key: $(mysqlKey) + bindingParameters: + databaseName: mysqldb2 + username: test2 + - operationId: Bindings_Get + - operationId: Bindings_List + - operationId: Bindings_Delete + + # CustomDomains + - operationId: CustomDomains_CreateOrUpdate + # - operationId: CustomDomains_Update # TODO: use another cert + - operationId: CustomDomains_Get + - operationId: CustomDomains_List + + # Deployments + - operationId: Apps_GetResourceUploadUrl + outputVariables: + uploadUrl: + type: secureString + fromResponse: /uploadUrl + relativePath: + type: string + fromResponse: /relativePath + + - armDeploymentScript: ./templates/uploadJar.ps1 + environmentVariables: + - name: uploadUrl + value: $(uploadUrl) + - name: blobUrl + value: $(blobUrl) + - operationId: Deployments_CreateOrUpdate + parameters: + deploymentName: blue + variables: + deploymentResource: + type: object + patches: + - replace: /sku/capacity + value: 2 + - replace: /properties/source/relativePath + value: $(relativePath) + - operationId: Apps_Update + parameters: + appResource: + properties: + activeDeploymentName: $(deploymentName) + - operationId: Deployments_Restart + parameters: + deploymentName: blue + - operationId: Deployments_Stop + parameters: + deploymentName: blue + - operationId: Deployments_Start + parameters: + deploymentName: blue + - operationId: Deployments_GetLogFileUrl + parameters: + deploymentName: blue + - operationId: Deployments_List + parameters: + deploymentName: blue + - operationId: Deployments_ListForCluster + parameters: + deploymentName: blue + - operationId: Services_List + - operationId: Services_ListBySubscription + - operationId: Deployments_Delete + parameters: + deploymentName: blue + - operationId: CustomDomains_Delete + - operationId: Apps_Delete + - operationId: Certificates_Delete + - operationId: Services_Delete + - operationId: Skus_List + # - operationId: RuntimeVersions_ListRuntimeVersions + - operationId: Operations_List + +cleanUpSteps: + - armDeploymentScript: ./templates/delete_cname_record.ps1 + environmentVariables: + - name: resourceGroupName + value: $(dnsResourceGroup) + - name: dnsCname + value: $(dnsCname) + - name: dnsZoneName + value: $(customDomainName) + variables: + subscriptionId: $(dnsSubscriptionId) + resourceGroupName: $(dnsResourceGroup) diff --git a/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2020-11-01-preview/scenarios/templates/create_application_insights_instance.json b/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2020-11-01-preview/scenarios/templates/create_application_insights_instance.json new file mode 100644 index 000000000000..5d24c3a381a6 --- /dev/null +++ b/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2020-11-01-preview/scenarios/templates/create_application_insights_instance.json @@ -0,0 +1,34 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "name": { + "type": "string", + "defaultValue": "asc-api-ai-instance", + "metadata": { + "description": "Name of Application Insights resource." + } + } + }, + "resources": [ + { + "name": "[parameters('name')]", + "type": "microsoft.insights/components", + "location": "eastus", + "tags": {}, + "apiVersion": "2014-04-01", + "properties": { + "ApplicationId": "[parameters('name')]", + "Application_Type": "web", + "Flow_Type": "Redfield", + "Request_Source": "CustomDeployment" + } + } + ], + "outputs": { + "insightsInstrumentationKey": { + "value": "[reference(resourceId('Microsoft.Insights/components', parameters('name')), '2014-04-01').InstrumentationKey]", + "type": "string" + } + } +} diff --git a/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2020-11-01-preview/scenarios/templates/create_cname_record.ps1 b/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2020-11-01-preview/scenarios/templates/create_cname_record.ps1 new file mode 100644 index 000000000000..a84c8c7999b1 --- /dev/null +++ b/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2020-11-01-preview/scenarios/templates/create_cname_record.ps1 @@ -0,0 +1,12 @@ +# Copyright (c) 2021 Microsoft Corporation +# +# This software is released under the MIT License. +# https://opensource.org/licenses/MIT +$resourceGroupName = ${Env:resourceGroupName} +$dnsCname = ${Env:dnsCname} +$dnsZoneName = ${Env:dnsZoneName} +$dnsCnameAlias = ${Env:dnsCnameAlias} +Connect-AzAccount -Identity +New-AzDnsRecordSet -Name $dnsCname -RecordType CNAME -ZoneName $dnsZoneName -ResourceGroupName $resourceGroupName -Ttl 3600 -DnsRecords (New-AzDnsRecordConfig -Cname $dnsCnameAlias) -Overwrite +$RecordSet = Get-AzDnsRecordSet -Name $dnsCname -RecordType CNAME -ResourceGroupName $resourceGroupName -ZoneName $dnsZoneName +$RecordSet \ No newline at end of file diff --git a/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2020-11-01-preview/scenarios/templates/delete_cname_record.ps1 b/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2020-11-01-preview/scenarios/templates/delete_cname_record.ps1 new file mode 100644 index 000000000000..a73d28f4afc7 --- /dev/null +++ b/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2020-11-01-preview/scenarios/templates/delete_cname_record.ps1 @@ -0,0 +1,9 @@ +$resourceGroupName = ${Env:resourceGroupName} +$dnsCNAME = ${Env:dnsCname} +$dnsZoneName = ${Env:dnsZoneName} + +Connect-AzAccount -Identity + +$RecordSet = Get-AzDnsRecordSet -Name $dnsCname -RecordType CNAME -ResourceGroupName $resourceGroupName -ZoneName $dnsZoneName +$Result = Remove-AzDnsRecordSet -RecordSet $RecordSet +$Result \ No newline at end of file diff --git a/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2020-11-01-preview/scenarios/templates/generate_service_name.json b/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2020-11-01-preview/scenarios/templates/generate_service_name.json new file mode 100644 index 000000000000..fc7bf101d631 --- /dev/null +++ b/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2020-11-01-preview/scenarios/templates/generate_service_name.json @@ -0,0 +1,20 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "serviceNamePrefix": { + "type": "string", + "defaultValue": "asc-" + } + }, + "variables": { + "serviceNameLong": "[concat(parameters('serviceNamePrefix'), uniqueString(resourceGroup().id))]" + }, + "resources": [], + "outputs": { + "serviceName": { + "type": "string", + "value": "[substring(variables('serviceNameLong'), 0, 12)]" + } + } +} \ No newline at end of file diff --git a/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2020-11-01-preview/scenarios/templates/uploadJar.ps1 b/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2020-11-01-preview/scenarios/templates/uploadJar.ps1 new file mode 100644 index 000000000000..0379eb20bb1c --- /dev/null +++ b/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2020-11-01-preview/scenarios/templates/uploadJar.ps1 @@ -0,0 +1,18 @@ +$uploadUri = ${Env:uploadUrl} +$blobUri = ${Env:blobUrl} +$localFilePath = '/tmp/temp.file' +function DownloadJarFromBlob([string]$blobUri, [string]$localOutputFilePath) { + $BlobFile = [Microsoft.WindowsAzure.Storage.Blob.CloudBlob]::new($blobUri) + $DownLoadTask = $BlobFile.DownloadToFileAsync($localOutputFilePath, 4) + $DownLoadTask +} + +function UploadToFileShare([string]$uploadUri, [string]$localFilePath) { + $CloudFile = [Microsoft.WindowsAzure.Storage.File.CloudFile]::New($uploadUri) + $UploadTask = $CloudFile.UploadFromFileAsync($localFilePath) + $UploadTask +} + +Connect-AzAccount -Identity +DownloadJarFromBlob $blobUri $localFilePath +UploadToFileShare $uploadUri $localFilePath \ No newline at end of file diff --git a/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/scenarios/basic.yaml b/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/scenarios/basic.yaml new file mode 100644 index 000000000000..1c493f2be39d --- /dev/null +++ b/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/scenarios/basic.yaml @@ -0,0 +1,149 @@ +scope: ResourceGroup +variables: + profileName: yfkzxcpmbbks + endpointName: ziccokwwusgsjojtvwvt + originGroupName: xqnyjeupwfhhxlralsdreuhtuvw + ruleSetName: skeuzqweiogqedwaocyspss + customDomainName: ugyvrutbrs + originName: alch + routeName: lfx + ruleName: rfbeekqbv + securityPolicyName: rwwrrbmqqfxms + metrics: [] + dateTimeBegin: '2022-03-15T06:49:28.115Z' + dateTimeEnd: '2022-03-15T06:49:28.115Z' + secretName: ssttxuducrpenrxmlwveykf + granularity: PT5M + rankings: [] + maxRanking: 22 + checkEndpointNameAvailabilityInput: + type: object + value: + name: ydtrmxayjcinwo + type: Microsoft.Cdn/Profiles/Endpoints + checkHostNameAvailabilityInput: + type: object + value: + hostName: iobvcrtxwurvukwxqtofcfymifam + customDomain: + type: object + value: {} + customDomainUpdateProperties: + type: object + value: {} + endpoint: + type: object + value: + location: $(location) + endpointUpdateProperties: + type: object + value: {} + contents: + type: object + value: + contentPaths: + - lpbofkt + customDomainProperties: + type: object + value: + hostName: vlbhs + originGroup: + type: object + value: {} + originGroupUpdateProperties: + type: object + value: {} + origin: + type: object + value: {} + originUpdateProperties: + type: object + value: {} + route: + type: object + value: {} + routeUpdateProperties: + type: object + value: {} + rule: + type: object + value: {} + ruleUpdateProperties: + type: object + value: {} + securityPolicy: + type: object + value: {} + securityPolicyUpdateProperties: + type: object + value: {} + secret: + type: object + value: {} + validateSecretInput: + type: object + value: + secretSource: {} + secretType: UrlSigningKey + customDomains: [] + protocols: [] +scenarios: + - steps: + - operationId: AFDEndpoints_Create + - operationId: AFDEndpoints_ListByProfile + - operationId: AFDEndpoints_Get + - operationId: AFDEndpoints_Update + - operationId: AFDEndpoints_ValidateCustomDomain + - operationId: AFDEndpoints_PurgeContent + - operationId: AFDEndpoints_ListResourceUsage + - operationId: AFDOriginGroups_Create + - operationId: AFDOriginGroups_ListByProfile + - operationId: AFDOriginGroups_Get + - operationId: AFDOriginGroups_Update + - operationId: AFDOriginGroups_ListResourceUsage + - operationId: RuleSets_Create + - operationId: RuleSets_ListByProfile + - operationId: RuleSets_Get + - operationId: RuleSets_ListResourceUsage + - operationId: AFDCustomDomains_Create + - operationId: AFDCustomDomains_ListByProfile + - operationId: AFDCustomDomains_Get + - operationId: AFDCustomDomains_Update + - operationId: AFDCustomDomains_RefreshValidationToken + - operationId: Rules_Create + - operationId: Rules_ListByRuleSet + - operationId: Rules_Get + - operationId: Rules_Update + - operationId: AFDOrigins_Create + - operationId: AFDOrigins_ListByOriginGroup + - operationId: AFDOrigins_Get + - operationId: AFDOrigins_Update + - operationId: SecurityPolicies_Create + - operationId: SecurityPolicies_ListByProfile + - operationId: SecurityPolicies_Get + - operationId: SecurityPolicies_Patch + - operationId: Routes_Create + - operationId: Routes_ListByEndpoint + - operationId: Routes_Get + - operationId: Routes_Update + - operationId: Secrets_Create + - operationId: Secrets_ListByProfile + - operationId: Secrets_Get + - operationId: Validate_Secret + - operationId: AFDProfiles_CheckHostNameAvailability + - operationId: LogAnalytics_GetLogAnalyticsLocations + - operationId: LogAnalytics_GetLogAnalyticsMetrics + - operationId: LogAnalytics_GetLogAnalyticsRankings + - operationId: LogAnalytics_GetLogAnalyticsResources + - operationId: LogAnalytics_GetWafLogAnalyticsMetrics + - operationId: LogAnalytics_GetWafLogAnalyticsRankings + - operationId: AFDProfiles_ListResourceUsage + - operationId: Secrets_Delete + - operationId: Routes_Delete + - operationId: SecurityPolicies_Delete + - operationId: AFDOrigins_Delete + - operationId: Rules_Delete + - operationId: AFDCustomDomains_Delete + - operationId: RuleSets_Delete + - operationId: AFDOriginGroups_Delete + - operationId: AFDEndpoints_Delete diff --git a/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/scenarios/quickstart.yaml b/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/scenarios/quickstart.yaml new file mode 100644 index 000000000000..9aaed2ab0797 --- /dev/null +++ b/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/scenarios/quickstart.yaml @@ -0,0 +1,209 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/documentation/api-scenario/references/v1.2/schema.json + +scope: ResourceGroup + +prepareSteps: + - armTemplate: ./templates/Generate_Unique_name_template.json + +scenarios: + - scenario: quickStart + variables: + ruleSetName: ruleSet1 + ruleName: rule1 + rule: + type: object + value: + properties: + order: 1 + conditions: + - name: RequestMethod + parameters: + typeName: DeliveryRuleRequestMethodConditionParameters + operator: Equal + matchValues: + - GET + negateCondition: false + actions: + - name: ModifyResponseHeader + parameters: + typeName: DeliveryRuleHeaderActionParameters + headerAction: Overwrite + headerName: X-CDN + value: MSFT + steps: + # Profiles + - operationId: Profiles_Create + parameters: + profile: + location: Global + sku: + name: Standard_AzureFrontDoor + properties: + originResponseTimeoutSeconds: 60 + - operationId: AFDProfiles_CheckHostNameAvailability + parameters: + checkHostNameAvailabilityInput: + hostName: azure.com + - operationId: AFDProfiles_ListResourceUsage + + # AFD endpoints + - operationId: CheckEndpointNameAvailability + parameters: + checkEndpointNameAvailabilityInput: + name: $(endpointName) + type: Microsoft.Cdn/Profiles/AfdEndpoints + autoGeneratedDomainNameLabelScope: TenantReuse + - operationId: AFDEndpoints_Create + parameters: + endpoint: + location: Global + properties: + enabledState: Enabled + - operationId: AFDEndpoints_Get + - operationId: AFDEndpoints_Update + parameters: + endpointUpdateProperties: + tags: + hello: world + properties: + enabledState: Disabled + - operationId: AFDEndpoints_Update + parameters: + endpointUpdateProperties: + tags: + foo: bar + rg: $(resourceGroupName) + properties: + enabledState: Enabled + - operationId: AFDEndpoints_ListByProfile + - operationId: AFDEndpoints_ListResourceUsage + - operationId: AFDEndpoints_PurgeContent + parameters: + contents: + contentPaths: + - /folder1 + domains: + - endpoint1.azureedge.net + + # AFD Origins + - operationId: AFDOriginGroups_Create + parameters: + originGroup: + properties: + loadBalancingSettings: + sampleSize: 4 + successfulSamplesRequired: 3 + additionalLatencyInMilliseconds: 50 + healthProbeSettings: + probePath: / + probeRequestType: HEAD + probeProtocol: Http + probeIntervalInSeconds: 100 + sessionAffinityState: Disabled + - operationId: AFDOriginGroups_Get + - operationId: AFDOriginGroups_ListByProfile + - operationId: AFDOriginGroups_ListResourceUsage + - operationId: AFDOrigins_Create + parameters: + origin: + properties: + hostName: portal.test.azure-devex-tools.com + httpPort: 80 + httpsPort: 443 + originHostHeader: portal.test.azure-devex-tools.com + priority: 1 + weight: 1000 + enabledState: Enabled + enforceCertificateNameCheck: true + - operationId: AFDOrigins_Get + - operationId: AFDOrigins_Update + parameters: + originUpdateProperties: + properties: + hostName: validate.test.azure-devex-tools.com + httpPort: 8080 + httpsPort: 8443 + enabledState: Disabled + - operationId: AFDOrigins_Update + parameters: + originUpdateProperties: + properties: + enabledState: Enabled + - operationId: AFDOrigins_ListByOriginGroup + + # AFD Routes & Rules + - operationId: Routes_Create + parameters: + route: + properties: + customDomains: [] + originGroup: + id: /subscriptions/$(subscriptionId)/resourceGroups/$(resourceGroupName)/providers/Microsoft.Cdn/profiles/$(profileName)/originGroups/$(originGroupName) + ruleSets: [] + supportedProtocols: + - Http + - Https + patternsToMatch: + - "/*" + forwardingProtocol: MatchRequest + linkToDefaultDomain: Enabled + httpsRedirect: Enabled + enabledState: Enabled + - operationId: RuleSets_Create + - operationId: RuleSets_Get + - operationId: RuleSets_Create + parameters: + ruleSetName: ruleSet2 + - operationId: RuleSets_ListByProfile + - operationId: Rules_Create + - operationId: Rules_Get + - operationId: Rules_Update + parameters: + ruleUpdateProperties: + properties: + order: 1 + actions: + - name: ModifyResponseHeader + parameters: + typeName: DeliveryRuleHeaderActionParameters + headerAction: Overwrite + headerName: X-CDN + value: MSFT + - operationId: Rules_Create + parameters: + ruleName: rule2 + variables: + rule: + type: object + patches: + - replace: /properties/order + value: 2 + - replace: /properties/conditions/0/parameters/negateCondition + value: true + - replace: /properties/actions/0/parameters/value + value: AZURE + - operationId: Rules_ListByRuleSet + - operationId: Routes_Update + parameters: + routeUpdateProperties: + properties: + ruleSets: + - id: /subscriptions/$(subscriptionId)/resourceGroups/$(resourceGroupName)/providers/Microsoft.Cdn/profiles/$(profileName)/ruleSets/$(ruleSetName) + - operationId: Routes_Get + + - operationId: LogAnalytics_GetLogAnalyticsLocations + parameters: + metrics: clientRequestCount + granularity: PT5M + groupBy: httpStatusCode + dateTimeBegin: "2022-03-15T05:00:00.000Z" + dateTimeEnd: "2022-03-15T06:00:00.000Z" + + - operationId: Rules_Delete + parameters: + ruleName: rule2 + - operationId: Routes_Delete + - operationId: AFDOrigins_Delete + - operationId: AFDOriginGroups_Delete + - operationId: AFDEndpoints_Delete + - operationId: Profiles_Delete \ No newline at end of file diff --git a/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/scenarios/templates/Generate_Unique_name_template.json b/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/scenarios/templates/Generate_Unique_name_template.json new file mode 100644 index 000000000000..9673b72cc6f9 --- /dev/null +++ b/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/scenarios/templates/Generate_Unique_name_template.json @@ -0,0 +1,56 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "profileNamePrefix": { + "type": "string", + "defaultValue": "afdx-p-" + }, + "originGroupNamePrefix": { + "type": "string", + "defaultValue": "afdx-og-" + }, + "originNamePrefix": { + "type": "string", + "defaultValue": "afdx-o-" + }, + "endpointNamePrefix": { + "type": "string", + "defaultValue": "afdx-ed-" + }, + "routeNamePrefix": { + "type": "string", + "defaultValue": "afdx-r-" + } + }, + "variables": { + "profileName": "[concat(parameters('profileNamePrefix'), uniqueString(resourceGroup().id))]", + "originGroupName": "[concat(parameters('originGroupNamePrefix'), uniqueString(resourceGroup().id))]", + "originName": "[concat(parameters('originNamePrefix'), uniqueString(resourceGroup().id))]", + "endpointName": "[concat(parameters('endpointNamePrefix'), uniqueString(resourceGroup().id))]", + "routeName": "[concat(parameters('routeNamePrefix'), uniqueString(resourceGroup().id))]" + }, + "resources": [], + "outputs": { + "profileName": { + "type": "string", + "value": "[variables('profileName')]" + }, + "originGroupName": { + "type": "string", + "value": "[variables('originGroupName')]" + }, + "originName": { + "type": "string", + "value": "[variables('originName')]" + }, + "endpointName": { + "type": "string", + "value": "[variables('endpointName')]" + }, + "routeName": { + "type": "string", + "value": "[variables('routeName')]" + } + } +} diff --git a/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/scenarios/keyvault.yaml b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/scenarios/keyvault.yaml new file mode 100644 index 000000000000..dd90de5caecd --- /dev/null +++ b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/scenarios/keyvault.yaml @@ -0,0 +1,85 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/documentation/api-scenario/references/v1.2/schema.json +scope: ResourceGroup + +variables: + azureTenantId: + type: string + vaultName: scenariosvault + +prepareSteps: + - step: Generate_Unique_Name + armTemplate: ./peArmTemplate/Generate_Unique_name_template.json + - step: Vault_Create + exampleFile: ../examples/createVault.json + requestUpdate: + - replace: /parameters/properties/tenantId + value: $(azureTenantId) + - replace: /parameters/properties/accessPolicies/0/tenantId + value: $(azureTenantId) + +scenarios: + - scenario: Vault + description: Microsoft.KeyVault/vaults CRUD + steps: + - step: Vault_CheckNameAvailability + exampleFile: ../examples/checkVaultNameAvailability.json + - step: Vault_Update + exampleFile: ../examples/updateVault.json + requestUpdate: + - replace: /parameters/properties/tenantId + value: $(azureTenantId) + - replace: /parameters/properties/accessPolicies/0/tenantId + value: $(azureTenantId) + - step: Vault_UpdateAccessPoliciesAdd + exampleFile: ../examples/updateAccessPoliciesAdd.json + requestUpdate: + - replace: /properties/accessPolicies/0/tenantId + value: $(azureTenantId) + - step: Vault_Get + exampleFile: ../examples/getVault.json + - step: Vault_List + exampleFile: ../examples/listVault.json + - step: Vault_ListByResourceGroup + exampleFile: ../examples/listVaultByResourceGroup.json + - step: Vault_ListBySubscription + exampleFile: ../examples/listVaultBySubscription.json + + - scenario: Key + description: Microsoft.KeyVault/vaults/keys CRUD + variables: + keyName: scenarioskey + steps: + - step: Key_Create + exampleFile: ../examples/createKey.json + - step: Key_Get + exampleFile: ../examples/getKey.json + - step: Key_List + exampleFile: ../examples/listKeys.json + - step: Key_GetVersion + exampleFile: ../examples/getKeyVersion.json + - step: Key_ListVersion + exampleFile: ../examples/listKeyVersions.json + + - scenario: Secret + description: Microsoft.KeyVault/vaults/secrets CRUD + variables: + secretName: scenariossecret + steps: + - step: Secret_Create + exampleFile: ../examples/createSecret.json + - step: Secret_Update + exampleFile: ../examples/updateSecret.json + - step: Secret_Get + exampleFile: ../examples/getSecret.json + - step: Secret_List + exampleFile: ../examples/listSecrets.json + +cleanUpSteps: + - step: Vault_Delete + exampleFile: ../examples/deleteVault.json + - step: Vault_GetDeleted + exampleFile: ../examples/getDeletedVault.json + - step: Vault_ListDeleted + exampleFile: ../examples/listDeletedVaults.json + - step: Vault_PurgeDelete + exampleFile: ../examples/purgeDeletedVault.json \ No newline at end of file diff --git a/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/scenarios/peArmTemplate/Generate_Unique_name_template.json b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/scenarios/peArmTemplate/Generate_Unique_name_template.json new file mode 100644 index 000000000000..63711c2037a6 --- /dev/null +++ b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/scenarios/peArmTemplate/Generate_Unique_name_template.json @@ -0,0 +1,20 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "variables": { + "name": { + "value": "[concat('sw',uniqueString(resourceGroup().id))]", + "metadata": { + "description": "Name of the SignalR service." + }, + "type": "string" + } + }, + "resources": [], + "outputs": { + "resourceName": { + "type": "string", + "value": "[variables('name').value]" + } + } +} diff --git a/specification/signalr/resource-manager/Microsoft.SignalRService/preview/2021-06-01-preview/scenarios/peArmTemplate/Generate_Unique_name_template.json b/specification/signalr/resource-manager/Microsoft.SignalRService/preview/2021-06-01-preview/scenarios/peArmTemplate/Generate_Unique_name_template.json new file mode 100644 index 000000000000..63711c2037a6 --- /dev/null +++ b/specification/signalr/resource-manager/Microsoft.SignalRService/preview/2021-06-01-preview/scenarios/peArmTemplate/Generate_Unique_name_template.json @@ -0,0 +1,20 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "variables": { + "name": { + "value": "[concat('sw',uniqueString(resourceGroup().id))]", + "metadata": { + "description": "Name of the SignalR service." + }, + "type": "string" + } + }, + "resources": [], + "outputs": { + "resourceName": { + "type": "string", + "value": "[variables('name').value]" + } + } +} diff --git a/specification/signalr/resource-manager/Microsoft.SignalRService/preview/2021-06-01-preview/scenarios/signalR.yaml b/specification/signalr/resource-manager/Microsoft.SignalRService/preview/2021-06-01-preview/scenarios/signalR.yaml new file mode 100644 index 000000000000..568b28254904 --- /dev/null +++ b/specification/signalr/resource-manager/Microsoft.SignalRService/preview/2021-06-01-preview/scenarios/signalR.yaml @@ -0,0 +1,67 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/documentation/api-scenario/references/v1.2/schema.json +scope: ResourceGroup + +# variables: +# resourceName: signalrswaggertest4 + +scenarios: + - scenario: SignalR + description: Microsoft.SignalRService/Basic_CRUD + steps: + # arm template deployment is not fully supported now. Will enable and cover more cases once it has more features + - step: Generate_Unique_Name + armTemplate: ./peArmTemplate/Generate_Unique_name_template.json + + - step: SignalR_CheckNameAvailability + exampleFile: ../examples/SignalR_CheckNameAvailability.json + requestUpdate: + - replace: /parameters/name + value: $(resourceName) + + # The example is actually an update operation. But in this context, here it is a create operation. The result will dismatch in pe part. + # Also, some validations like for keys kike IP or pec ID needs to be suppressed + - step: SignalR_CreateOrUpdate + exampleFile: ../examples/SignalR_CreateOrUpdate.json + + - step: SignalR_Get + exampleFile: ../examples/SignalR_Get.json + + # Bug. The patch operation is not validated. + - step: SignalR_Update + exampleFile: ../examples/SignalR_Update.json + + # The key should not be printed and should not be compared. + - step: SignalR_ListKeys + exampleFile: ../examples/SignalR_ListKeys.json + + # We don't have a 200 response for this operation in this API version. + - step: SignalR_RegenerateKey + exampleFile: ../examples/SignalR_RegenerateKey.json + + - step: SignalR_Restart + exampleFile: ../examples/SignalR_Restart.json + + - step: Usages_List + exampleFile: ../examples/Usages_List.json + + - step: SignalR_ListByResourceGroup + exampleFile: ../examples/SignalR_ListByResourceGroup.json + + - step: SignalR_ListBySubscription + exampleFile: ../examples/SignalR_ListBySubscription.json + + - step: Operations_List + exampleFile: ../examples/Operations_List.json + + - step: SignalR_Delete + exampleFile: ../examples/SignalR_Delete.json +# - description: Microsoft.SignalRService/SignalRPrivateLinkResources_List +# steps: +# - step: prepare_pe +# armTemplate: ./peArmTemplate/template.json +# - step: SignalRPrivateEndpointConnections_Get +# exampleFile: ../examples/SignalRPrivateEndpointConnections_Get.json +# - step: SignalRPrivateEndpointConnections_Update +# exampleFile: ../examples/SignalRPrivateEndpointConnections_Update.json +# - step: SignalRPrivateEndpointConnections_Delete +# exampleFile: ../examples/SignalRPrivateEndpointConnections_Delete.json diff --git a/specification/signalr/resource-manager/Microsoft.SignalRService/preview/2021-06-01-preview/scenarios/signalr_crud.yaml b/specification/signalr/resource-manager/Microsoft.SignalRService/preview/2021-06-01-preview/scenarios/signalr_crud.yaml new file mode 100644 index 000000000000..c91869cab2fb --- /dev/null +++ b/specification/signalr/resource-manager/Microsoft.SignalRService/preview/2021-06-01-preview/scenarios/signalr_crud.yaml @@ -0,0 +1,90 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/documentation/api-scenario/references/v1.2/schema.json +scope: ResourceGroup + +variables: + resourceName: signalrswaggertest6 + parameters: + type: object + value: + sku: + name: Standard_S1 + tier: Standard + capacity: 1 + properties: + tls: + clientCertEnabled: false + features: + - flag: ServiceMode + value: Serverless + properties: {} + - flag: EnableConnectivityLogs + value: "True" + properties: {} + - flag: EnableMessagingLogs + value: "False" + properties: {} + - flag: EnableLiveTrace + value: "False" + properties: {} + cors: + allowedOrigins: + - https://foo.com + - https://bar.com + upstream: + templates: + - hubPattern: "*" + eventPattern: connect,disconnect + categoryPattern: "*" + urlTemplate: https://example.com/chat/api/connect + auth: + type: ManagedIdentity + managedIdentity: + resource: api://example + networkACLs: + defaultAction: Deny + publicNetwork: + allow: + - ClientConnection + privateEndpoints: + - name: mysignalrservice.1fa229cd-bf3f-47f0-8c49-afb36723997e + allow: + - ServerConnection + publicNetworkAccess: Enabled + disableLocalAuth: false + disableAadAuth: false + kind: SignalR + identity: + type: SystemAssigned + location: eastus + tags: + key1: value1 + +scenarios: + - steps: + - step: Generate_Unique_Name + armTemplate: ./peArmTemplate/Generate_Unique_name_template.json + + - operationId: SignalR_CheckNameAvailability + parameters: + parameters: + type: Microsoft.SignalRService/SignalR + name: $(resourceName) + - operationId: SignalR_CreateOrUpdate + - operationId: SignalR_Get + - operationId: SignalR_Update + variables: + parameters: + type: object + patches: + - replace: /properties/tls/clientCertEnabled + value: true + - operationId: SignalR_ListKeys + - operationId: SignalR_RegenerateKey + parameters: + parameters: {} + - operationId: SignalR_Restart + - operationId: Usages_List + - operationId: SignalR_ListByResourceGroup + - operationId: SignalR_ListBySubscription + - operationId: Operations_List + - operationId: SignalR_Delete diff --git a/specification/webpubsub/data-plane/WebPubSub/preview/2021-08-01-preview/scenarios/basic.yaml b/specification/webpubsub/data-plane/WebPubSub/preview/2021-08-01-preview/scenarios/basic.yaml new file mode 100644 index 000000000000..6b81392fc9c7 --- /dev/null +++ b/specification/webpubsub/data-plane/WebPubSub/preview/2021-08-01-preview/scenarios/basic.yaml @@ -0,0 +1,21 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/documentation/api-scenario/references/v1.2/schema.json +scope: ResourceGroup + +variables: + Endpoint: https://endpoint.net + api-version: '2021-08-01-preview' + hub: myHub + +scenarios: + - variables: + hub: myHub2 + steps: + - operationId: WebPubSub_GenerateClientToken + parameters: + role: + - read + - write + minutesToExpire: 120 + outputVariables: + clientToken: + fromResponse: /token diff --git a/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2021-09-01-preview/scenarios/quickstart.yaml b/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2021-09-01-preview/scenarios/quickstart.yaml new file mode 100644 index 000000000000..f81d2c91a7c5 --- /dev/null +++ b/specification/webpubsub/resource-manager/Microsoft.SignalRService/preview/2021-09-01-preview/scenarios/quickstart.yaml @@ -0,0 +1,41 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/documentation/api-scenario/references/v1.2/schema.json +scope: ResourceGroup + +variables: + api-version: '2021-09-01-preview' + location: eastus + resourceNamePrefix: myWebPubSubService + +scenarios: + - scenario: quickStart + description: Quick start to use WebPubSub service + steps: + - step: checkNameAvailability # default to $(operationId)_$(stepIndex) + operationId: WebPubSub_CheckNameAvailability + parameters: + parameters: + type: Microsoft.SignalRService/WebPubSub + name: $(resourceNamePrefix)-$(stepIndex) + # responses: + # 200: + # headers: + # body: + outputVariables: + resourceName: + fromRequest: /parameters/name + type: string + - operationId: WebPubSub_CreateOrUpdate + parameters: + resourceName: $(resourceName) # can be omitted by convention + parameters: + sku: Free + # responses: + # 200: + - operationId: WebPubSub_Get + swagger: ../swagger/swagger.json + parameters: + resourceName: $(resourceName) + # responses: + # 200: + # headers: + # body: \ No newline at end of file