azure 相关问题

Microsoft Azure是一种平台即服务和基础架构即服务云计算平台 - 关于编程的唯一问题是主题。可以在超级用户或服务器故障中获取常规服务器帮助。

使用正确的行对齐方式替换多个文件中的文本使用-powershell.ps1

输出没有得到相同的行对齐替换..但它没有得到相同的对齐(它应该替换3行。但它会进行之字形替换..看起来很难看,有什么帮助吗 输出没有得到相同的行对齐替换..但它没有得到相同的对齐(它应该替换3行。但它会进行之字形替换..看起来很难看,有什么帮助吗 发票 世界 你好 `$configFiles = Get-ChildItem . *.csconfigini -rec foreach ($file in $configFiles) { try { Write-Host "Processing $($file.FullName)" $content = Get-Content $file.PSPath -Raw -ErrorAction Stop if ($content -match "(<BatchReleaseType>datacenter</BatchReleaseType>)") { Write-Host "Match found in $($file.FullName)" $leadingWhitespace = $matches[1] -replace '<String>Invoice</battery>.*', '' $replacement = @" ${leadingWhitespace}<Hello world=""`'$($Apple)'=='Hero'"">Invoice</battery> ${leadingWhitespace} <Sunday>World</Sunday> ${leadingWhitespace} <battery>Hello</battery> "@ $content = $content -replace "<String>Invoice</battery>", $replacement $content | Set-Content $file.PSPath -ErrorAction Stop Write-Host "Replacement done for $($file.FullName)" } else { Write-Host "No match found in $($file.FullName)" } } catch [System.UnauthorizedAccessException] { Write-Host "Skipping file $($file.PSPath) due to permission issue." } catch { Write-Host "Error occurred while processing $($file.PSPath): $_" } } ` 我尝试使用下面的Azure Functions Powershell http trigger代码和替换已成功完成,请参阅下面:- using namespace System.Net # Input bindings are passed in via param block. param($Request, $TriggerMetadata) # Write to the Azure Functions log stream. Write-Host "PowerShell HTTP trigger function processed a request." # Define the PowerShell script $script = @' $configFiles = Get-ChildItem . *.csconfigini -rec foreach ($file in $configFiles) { try { Write-Host "Processing $($file.FullName)" $content = Get-Content $file.PSPath -Raw -ErrorAction Stop if ($content -match "(<BatchReleaseType>datacenter</BatchReleaseType>)") { Write-Host "Match found in $($file.FullName)" $leadingWhitespace = $matches[1] -replace '<String>Invoice</battery>.*', '' $replacement = @" ${leadingWhitespace}<Hello world=""`'$($Apple)'=='Hero'"">Invoice</battery> ${leadingWhitespace} <Sunday>World</Sunday> ${leadingWhitespace} <battery>Hello</battery> "@ $pattern = "<String>Invoice</battery>" $content = $content -replace $pattern, $replacement $content | Set-Content $file.PSPath -ErrorAction Stop Write-Host "Replacement done for $($file.FullName)" } else { Write-Host "No match found in $($file.FullName)" } } catch [System.UnauthorizedAccessException] { Write-Host "Skipping file $($file.PSPath) due to permission issue." } catch { Write-Host "Error occurred while processing $($file.PSPath): $_" } } '@ # Execute the PowerShell script Invoke-Expression $script # Interact with query parameters or the body of the request. $name = $Request.Query.Name if (-not $name) { $name = $Request.Body.Name } $body = "This HTTP triggered function executed successfully. Pass a name in the query string or in the request body for a personalized response." if ($name) { $body = "Hello, $name. This HTTP triggered function executed successfully." } # Associate values to output bindings by calling 'Push-OutputBinding'. Push-OutputBinding -Name Response -Value ([HttpResponseContext]@{ StatusCode = [HttpStatusCode]::OK Body = $body }) 输出:- 替换内容:- <BatchReleaseType>datacenter</BatchReleaseType> <BatchReleaseType>datacenter</BatchReleaseType><Hello world=""''=='Hero'"">Invoice</battery> <BatchReleaseType>datacenter</BatchReleaseType> <Sunday>World</Sunday> <BatchReleaseType>datacenter</BatchReleaseType> <battery>Hello</battery> <AnotherTag>SomeValue</AnotherTag>

回答 1 投票 0

无法创建和使用令牌来为团队用户使用 ACS:“CallAgent 必须仅使用 ACS 令牌创建。”

我正在尝试遵循两个教程,两个教程都有效,但我的用例仍然出现错误。 首先是如何在此处为 Teams 用户获取 ACS 令牌(对于直接在教程中跳转的 C# 代码)(

回答 1 投票 0

GitLab 将容器应用程序部署到 Azure 应用服务

我已经设置了一个使用容器发布模型的Azure应用服务。一切都按预期进行,但我想使用 GitLab 管道自动化部署。因此,我创建了一个服务

回答 1 投票 0

在 ADF 中,我想在接收器中创建一个表,并使用该表创建主键。我怎样才能做到这一点?

假设我有一个源表Table1,以PK为ID,那么如何在sink中创建与Table1相同的表,其中包含PK ID? 我想首先通过 ADF 创建表,然后使用

回答 1 投票 0

在azure synapse管道中创建季度日期数组

我正在 Azure Synapse Pipeline 环境中工作,我正在尝试初始化一个包含日期“03-31”、“06-30”、“09-30”和“12-31”的数组...

回答 1 投票 0

Azure 函数拒绝作为 .NET 隔离工作线程运行? (例外:Microsoft.Azure.Functions.Worker.FunctionInputConverterException)

我在.NET 4.8中有一个Azure函数(由于WCF而卡在这个框架上)。 该函数正在尝试使用 ServiceBusTrigger 从 Azure Servicebus 接收消息。 我得到一个例外: 无法转换...

回答 1 投票 0

有没有办法从 Azure DevOps 分析视图中提取每小时分析以在 PowerBI 中使用

我目前有一个 PowerBi 仪表板,可以使用分析视图直接从 Azure DevOps 提取数据。目前,我有每个开发人员的每日数据,但管理层希望查看状态

回答 1 投票 0

Azure OpenAI 助手型号名称

我正在尝试使用 Azure OpenAI 服务制作 OpenAI 助手,请按照此处的说明进行操作:https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/assistant 。我创建了一个 A...

回答 1 投票 0

如何使用 Lucene 语法使用 Azure AI 搜索过滤器进行空格搜索

我正在使用 Azure 搜索和 azure.search.documents.SearchOptions 我有这个有效 搜索选项 搜索选项 = 新的搜索选项() .setFilter("search.ismatch('.*golden.*', '描述...

回答 1 投票 0

Azure 函数拒绝作为 .NET 隔离工作线程运行?

我在.NET 4.8中有一个Azure函数(由于WCF而卡在这个框架上)。 该函数正在尝试使用 ServiceBusTrigger 从 Azure Servicebus 接收消息。 我得到一个例外: 无法转换...

回答 1 投票 0

从 MS CRM 插件(沙盒)向 Azure 服务总线发送自定义消息

我知道我可以在 MS CRM 中注册一个新的“服务端点”并使用它向 Azure 服务总线发送消息,但这......并不是我真正想要的。上述方法最终发送了一个串行...

回答 5 投票 0

我无法使用最新的 api 版本“2024-02-29-preview”调用 azue 文档智能 api

使用下面的代码,我无法使用预构建布局调用 Azure AI 文档智能的最新 api 版本“2024-02-29-preview”。我在正确的西欧地区...

回答 1 投票 0

使用 Azure 逻辑应用验证 Excel 文档并将其移动到 Sharepoint 中的不同文件夹?

自从我使用 Azure 逻辑应用程序以来已经有一段时间了,但我有一个客户用例,我们需要一个 excel 数据(可能是共享点)的(阶段)登陆位置,但在我们将该数据提取到我们的

回答 1 投票 0

运行java管道的代理问题

以上是我无法获取代理的错误描述,尽管代理在线且可用

回答 1 投票 0

在 PowerShell 中使用 AZ CLI 移动 Azure 资源组中的所有资源

我希望创建一个 Azure DevOps 管道,将资源组级别的资源移动到另一个具有空资源组的订阅。但是,我遇到了 Move-AzRes 的问题...

回答 1 投票 0

是否可以自动关闭 Azure VM 以节省成本?

我正在尝试从 Azure 门户创建 VM。 我按照此 Microsoft Doc 创建它:https://learn.microsoft.com/en-us/azure/virtual-machines/windows/quick-create-portal 我成功创建...

回答 3 投票 0

链接服务未出现在 Azure 数据工厂中

我正在执行 az datafactory 链接服务创建 命令,该命令在我的 ADF 中创建一个新的链接服务。这是可见的。但是,将 ADF 与 Git 集成后,相同的命令会返回

回答 2 投票 0

如何使用 Azure 门户清除 Cosmos DB 数据库或删除所有项目

如果转到 https://portal.azure.com,打开我们的 Azure Cosmos DB 帐户 (1) --> 数据资源管理器 (2) --> 单击用户 (3) --> 单击新建 SQL 查询: Azure 将打开一个文本框以输入查询...

回答 6 投票 0

为什么我在调用 POST 时会收到 CORS 错误?

我在 Azure 上有一个用户数据库,我正在尝试从我的 React 应用程序调用 POST。但每次尝试时,我都会收到此错误:Access to XMLHttpRequest at 'https://stin-backend-apimanag.azure-api.ne...

回答 1 投票 0

Azure 与 Node.js:丢失和未经授权的资源

我是部署方面的新手,刚刚开始使用azure。 我有一个项目,要求我在其中部署一个应用程序,该应用程序稍后必须与 Azure 的其他方面进行交互。所以我决定使用...

回答 1 投票 0

© www.soinside.com 2019 - 2024. All rights reserved.