小编Ken*_*y_I的帖子

在 Azure Pipeline 上使用 Terraform 删除或添加 Azure SQL 的资源锁需要什么权限

我有产品订阅,由于缺少权限,部署管道失败。我的 Azure AD 用户无权创建或删除 Azure SQL 的锁。

我想知道什么以及如何配置用户权限,以便 Azure Pipeline 可以创建、编辑或删除资源锁?

地形:

resource "azurerm_management_lock" "hellodb_lck" {
  for_each = var.databases
  name       = "can-not-delete"
  scope      = azurerm_sql_database.hellodb[each.key].id
  lock_level = "CanNotDelete"
}
Run Code Online (Sandbox Code Playgroud)

azure terraform azure-sql-database azure-pipelines azure-rbac

3
推荐指数
1
解决办法
9402
查看次数

ImportError:无法从“sqlalchemy.engine”导入名称“URL”

为什么我无法使 sqlalchemy.engine 正常工作?

我已经安装了 SQLAlchemy

 pip install SQLAlchemy
Run Code Online (Sandbox Code Playgroud)

我在Python中有以下代码

 from sqlalchemy.engine import URL
Run Code Online (Sandbox Code Playgroud)

它会导致错误:

ImportError: cannot import name 'URL' from 'sqlalchemy.engine' (C:\Python\Python3.8.9\lib\site- 
packages\sqlalchemy\engine\__init__.py)
Run Code Online (Sandbox Code Playgroud)

python sqlalchemy

3
推荐指数
1
解决办法
2万
查看次数

如何向 Azure 存储授予对 Azure Pipeline 的 Azure 文件副本的访问权限?

我想通过 Azure Pipeline 使用 Azure 文件复制来复制文件。

我正在遵循https://praveenkumarsreeram.com/2021/04/14/azure-devops-copy-files-from-git-repository-to-azure-storage-account/的说明

我正在使用自动创建的名为“My Sandbox (a1111e1-d30e-4e02-b047-ef6a5e901111)”的服务连接

我在 AzureBlob 文件复制时遇到错误:

 INFO: Authentication failed, it is either not correct, or 
 expired, or does not have the correct permission -> 
 github.com/Azure/azure-storage-blob-go/azblob.newStorageError, 
 /home/vsts/go/pkg/mod/github.com/!azure/azure-storage-blob- 
 go@v0.10.1-0.20201022074806- 
 8d8fc11be726/azblob/zc_storage_error.go:42

 RESPONSE Status: 403 This request is not authorized to perform 
 this operation using this permission.
Run Code Online (Sandbox Code Playgroud)

我假设 Azure Pipeline 无法访问 Azure 存储。我想知道如何找到应该访问 Azure 存储的服务主体。

azure-storage azure-devops

3
推荐指数
1
解决办法
3454
查看次数

如何使用 Terraform 将多个自定义操作添加到 Azure 逻辑应用程序?

我想使用 Terraform 部署 Azure 逻辑应用程序。我需要添加 2-3 个自定义操作。我目前正在测试添加 2 个变量。

我希望所有操作都相继运行,但目前操作是并行部署的。我不知道哪个参数决定操作是否应该并行部署或一个接一个地部署。

我已复制并粘贴以下代码:

https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/logic_app_trigger_http_request
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/logic_app_action_custom
Run Code Online (Sandbox Code Playgroud)

如何让动作依次部署?

在此输入图像描述 地形代码:

# Define Terraform provider
terraform {
  required_version = ">= 0.12"
}
# Configure the Azure provider
provider "azurerm" { 
  environment = "public"
  version = ">= 2.0.0"
  features {}  
}

resource "azurerm_resource_group" "example" {
  name     = "my-logicapp-rg"
  location = "West Europe"
}

resource "azurerm_logic_app_workflow" "example" {
  name                = "workflow1"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
}


resource "azurerm_logic_app_trigger_http_request" "example" {
  name         = "some-http-trigger"
  logic_app_id = azurerm_logic_app_workflow.example.id …
Run Code Online (Sandbox Code Playgroud)

terraform azure-logic-apps

2
推荐指数
1
解决办法
1718
查看次数

现在如何在Python中将时区设置为日期时间?

我想使用 GMT +0(英国)时区来调用当前的 datetime.now() 。我的工作站位于其他时区。

怎么做?

python

2
推荐指数
1
解决办法
4685
查看次数

如何为点到站点 VPN 添加网关子网?- 指定的地址范围与默认子网重叠

我正在尝试创建点到站点 VPN。我创建了新的虚拟网络。它的地址空间是\xc2\xa0172.16.0.0/24\n我正在尝试执行链接文章的步骤 2 以添加新的网关子网。但是我无法弄清楚我的地址范围有什么问题。如果我添加 172.16.0.0/24,它会显示“指定的地址范围与范围为 172.16.0.0/24 的子网默认值重叠”。如果我修改 IP,我会收到“不是有效的 CIDR 块。请改用 172.16.0.0/24。”\n https://learn.microsoft.com/en-us/azure/vpn-gateway/vpn-gateway-howto-点到站点资源管理器门户

\n

vpn azure

1
推荐指数
1
解决办法
7637
查看次数

Azure 应用服务计划 (Linux) 的扩展是否会导致停机?

我需要 Azure Functions 的更高性能。

从 P1v2 扩展到 P2v2 是否会导致服务停机?如果有的话,停机时间是多长?

azure-app-service-plans

1
推荐指数
1
解决办法
1913
查看次数

如何通过 Postman 将 ChatGPT 请求发送到 Azure OpenAI?

我想向 Azure OpenAI 的 ChatGPT 提问

我已经添加了帖子网址。我添加了参数“API_KEY”(从 Azure 门户复制的密钥),我添加了 json 正文。

我的访问被拒绝。我想密钥一定是正确的。有人可以发送示例工作 API 网址吗?

    "error": {
        "code": "401",
        "message": "Access denied due to invalid subscription key       or wrong API endpoint. Make sure to provide a valid key for an active       subscription and use a correct regional API endpoint for your   resource."
    } 
}. 
Run Code Online (Sandbox Code Playgroud)

azure azure-openai

1
推荐指数
1
解决办法
3666
查看次数