Added PS variables and committed suggested changes
This commit is contained in:
Sannidhya Glodha 2022-04-28 12:53:59 +05:30 коммит произвёл Serkant Karaca
Родитель ca828dd8fa
Коммит 7028e2d1cb
1 изменённых файлов: 12 добавлений и 5 удалений

Просмотреть файл

@ -7,11 +7,12 @@ $Fields = @{
client_secret = "<Application_Secret>"
};
#update tenant ID to the correct tenant where you would like to get authorization token from
$response = Invoke-RestMethod Uri "https://login.microsoftonline.com/<Tenant_ID>/oauth2/token" ContentType "application/x-www-form-urlencoded" Method POST Body $Fields
#response would have bearer token in the properties that we would use to trigger next call.
$token = $response.access_token
#Step 2- You can declare schema JSON associated to schema in $Body variable below
$Body = @"
{
@ -32,13 +33,19 @@ $Fields = @{
"@
#Step 3- This Uri needs to have details added- namespace name, schema group name and schema name respectively.
$uri = 'https://<Namespace_Name>.servicebus.windows.net/$schemagroups/<SchemaGroup_Name>/schemas/<Schema_Name>?api-version=2020-09-01-preview'
$NamespaceName = '<namespacename>'
$SchemaGroupName = '<schemagroupname>'
$SchemaName = '<SchemaName>'
$uri = "https://$NamespaceName.servicebus.windows.net/$schemagroups/$SchemaGroupName/schemas/$SchemaName`?api-version=2020-09-01-preview"
#Step 4- These headers would be sent along with the API Call
$headers = @{
"Content-Type" = "application/atom+xml;type=entry;charset=utf-8"
"Serialization-Type" = "Avro"
"Authorization" = "Bearer " + $response.access_token
"Authorization" = "Bearer " + $token
}
#Step 5- This step shows the final call that we make to add schema under the schema groups,