我的 webApi 在其中使用第三方 Web api 服务。问题是它在我的本地计算机和 Azure Web 服务中完美运行。但是当我将此解决方案转移到 Azure Vm 实例时,出现此错误。我已经安装了与第 3 方 Web api 相关的正确证书并注册了 HttpClient 并尝试了
ServicePointManager.Expect100Continue = true;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls11;
Run Code Online (Sandbox Code Playgroud)
但它给出了同样的错误。我不知道确切的错误是什么。有人可以帮忙解决这个问题吗?
我正在寻找一种 powershell 方法来断开虚拟机与 OMS 工作区的连接。
我编写了一个 powershell 脚本来将虚拟机移动到其他订阅。所以我必须将此虚拟机从“源工作区”重新连接到“目标工作区”。
只需删除 OMS 扩展,虚拟机就会在 Azure 门户“Log Analytics 工作区 > 工作区数据源 > 虚拟机”中显示为“未连接”。
这个 cmdlet 应该可以解决问题(文档不太清楚),但我总是收到相同的消息
remove-AzureRmOperationalInsightsDataSource -Workspace $OmsWkspceITS -Name CentosMove
Confirm
Are you sure you want to remove data source 'CentosMove' in workspace 'itsoms'?
[Y] Yes [N] No [S] Suspend [?] Help (default is "Yes"): yes
WARNING: DataSource 'CentosMove' does not exist in workspace 'itsoms'.
Run Code Online (Sandbox Code Playgroud)
(CentosMove 是我的虚拟机名称)。
我们的 ITSOMS 工作区已使用多年,拥有数百个虚拟机、许多解决方案、NSG 日志流分析......
$OmsWkspceITS
Name : itsoms
ResourceGroupName : rg_its_exploit
ResourceId : /subscriptions/blablabla/resourcegroups/blabla/providers/microsoft.operationalinsights/workspaces/itsoms …Run Code Online (Sandbox Code Playgroud) 我参考了github代码。请找到下面的URL
我修改了脚本并执行了 terraform init。我收到以下错误。
读取 azurerm_network_interface[main] 的配置时出错:在 1:18 处解析错误:预期为“)”,但发现为“.”[0m
我的脚本:
# Configure the Microsoft Azure Provider
provider "azurerm" {
subscription_id = "xxxxxxxx"
client_id = "xxxxxxxx"
client_secret = "xxxxxxxx"
tenant_id = "xxxxxxxx"
}
# Locate the existing custom/golden image
data "azurerm_image" "search" {
name = "AZLXSPTDEVOPS01_Image"
resource_group_name = "RG-PLATFORM"
}
output "image_id" {
value = "/subscriptions/4f5c9f2a-3584-4bbd-a26e-bbf69ffbfbe6/resourceGroups/RG-EASTUS-SPT-PLATFORM/providers/Microsoft.Compute/images/AZLXSPTDEVOPS01_Image"
}
# Create a Resource Group for the new Virtual Machine.
resource "azurerm_resource_group" "main" {
name = "RG-TEST"
location = "eastus"
}
# Create …Run Code Online (Sandbox Code Playgroud) 我想使用服务器 2016(Azure VM) 在 azure IIS 上部署一个网站,并希望在互联网上的任何地方访问它。我怎样才能做到这一点?我必须使用哪个 IP 地址来实现此目的?
iis virtual-machine azure windows-server-2016 azure-web-app-service
我在直接从浏览器连接到新实例时遇到问题。这实际上是 Fedora 操作系统的一个新实例,所以我没有配置任何东西。它不能开箱即用。
我还有其他带有 Debian 10 (Buster) 等操作系统的服务器,通过 SSH 连接时它们似乎工作正常。
以下是我用于虚拟机的服务器规格:
Machine type: e2-medium (2 vCPUs, 4 GB memory)
CPU platform: Intel Broadwell
Zone: us-central1-a
OS Image: fedora-coreos-34-20210904-3-0-gcp-x86-64
Disk Size: 30GB
Disk Type: SSD
Run Code Online (Sandbox Code Playgroud)
以下是来自串行端口的日志:(链接到来自串行端口的整个日志)
[ 545.747496] audit: type=2404 audit(1633250527.525:300): pid=1892 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:sshd_t:s0-s0:c0.c1023 msg='op=destroy kind=server fp=SHA256:80:d3:1d:38:a5:96:e3:02:50:e1:55:11:ec:61:1b:65:89:6e:08:ad:4d:50:09:82:2d:a6:cb:c8:fa:35:6c:c7 direction=? spid=1893 suid=74 exe="/usr/sbin/sshd" hostname=? addr=? terminal=? res=success'
[ 545.780996] audit: type=1109 audit(1633250527.525:301): pid=1892 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:sshd_t:s0-s0:c0.c1023 msg='op=PAM:bad_ident grantors=? acct="?" exe="/usr/sbin/sshd" hostname=74.125.73.141 addr=74.125.73.141 terminal=ssh res=failed'
[ 545.806261] audit: …Run Code Online (Sandbox Code Playgroud) 由于某种原因,我的虚拟机上的 jupyter 笔记本处于错误的环境中(即卡在(base))。此外,我可以更改终端中的环境,但不能更改笔记本中的环境。!conda activate desired_env这是我在笔记本中尝试时发生的情况:
CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
To initialize your shell, run
$ conda init <SHELL_NAME>
Currently supported shells are:
- bash
- fish
- tcsh
- xonsh
- zsh
- powershell
See 'conda init --help' for more information and options.
IMPORTANT: You may need to close and restart your shell after running 'conda init'.
# conda environments:
#
base * /anaconda
azureml_py36 /anaconda/envs/azureml_py36
azureml_py38 /anaconda/envs/azureml_py38 …Run Code Online (Sandbox Code Playgroud) virtual-machine azure conda jupyter-notebook azure-machine-learning-service
我想有一个VM来查看应用程序的显示方式以及开发特定于操作系统的应用程序,但是,我想将我的所有代码保存在我的Windows机器上,所以如果我决定修改VM或类似的东西,它仍然是那里.
如果重要,我正在使用VirtualBox.
我在Mac OS X(Xamarin Studio或本地语言)上进行所有移动开发,并使用Parallels在Visual Studio中使用Microsoft Azure移动服务后端.我已经到了想要测试Azure Mobile API的地步,但我不想为每次更改发布服务并调试它.
我的问题是我部署到我的IIS,快递或本地,在我的Mac物理主机上查看API的土地页面方面工作正常,但是当我点击试用它时我得到一个验证消息,检查屏幕截图,我现在不想要任何安全措施.
如何禁用它并从我的Mac测试我的Azure移动服务API,最终从我的移动项目中测试.

[编辑]
我应该提一下,从我的VM Windows 8中,IIS运行正常,我可以在没有任何用户名/密码的情况下访问API.
[编辑2]来自@lindydonna回答.
代理似乎工作正常,因为从我的Mac我可以调用localhost/MyApiService,它转到我的Windows 8 VM本地IIS服务器.
所以我可以访问API服务器,所有控制器及其端点,您选择一个端点并获取示例屏幕,单击试一试并且无法完成HTTP请求,404/NotFound错误.见截图.
这个要点中的GET请求的BODY .

以上是本地IIS设置中的问题,因为在尝试Azure移动服务测试页时,相同的行为适用于Windows 8 VM环境.
我使用Postman工作,它正确地返回JSON数据,iOS模拟器似乎不能与localhost一起使用.尝试拉取时,MobileServiceContext会引发异常.

protected virtual async Task PullAsync (IMobileServiceTableQuery<TEntity> query)
{
try {
await Initialization;
IMobileServiceSyncTable<TEntity> entityTable = GetTable ();
await entityTable.PullAsync (typeof(TEntity).ToString (), query); // <-- The System.Net.WebException thrown here.
await entityTable.PurgeAsync ();
} catch (MobileServiceInvalidOperationException preconditionFailedEx) {
Debug.WriteLine(preconditionFailedEx.Message);
}
}
Run Code Online (Sandbox Code Playgroud) 我使用的是RHEL OS类型的Azure VM.目前我正在使用标准D3 v2大小的VM.我看到VM中只有32个硬盘存储空间可用.如何增加硬盘的大小?
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 32G 32G 185M 100% /
devtmpfs 6.9G 0 6.9G 0% /dev
tmpfs 6.9G 0 6.9G 0% /dev/shm
tmpfs 6.9G 8.4M 6.9G 1% /run
tmpfs 6.9G 0 6.9G 0% /sys/fs/cgroup
/dev/sda1 497M 117M 381M 24% /boot
/dev/sdb1 197G 2.1G 185G 2% /mnt/resource
tmpfs 1.4G 0 1.4G 0% /run/user/1000
Run Code Online (Sandbox Code Playgroud)
注意:我使用的是非托管磁盘.
我可以在这里看到CIL指令列表:
https://en.wikipedia.org/wiki/List_of_CIL_instructions
我的理解是CIL在CLR中运行.但是,我看不出这些指令如何用于发出http请求(这在CLR中显然是可能的).
这些代码似乎都不是为了获取外部信息.
我错过了什么?
virtual-machine ×10
azure ×6
c# ×2
iis ×2
azure-machine-learning-service ×1
cil ×1
conda ×1
fedora ×1
gcloud ×1
hard-drive ×1
image ×1
powershell ×1
ssh ×1
ssl ×1
terraform ×1
virtualbox ×1